#multiplayer

1 messages · Page 607 of 1

vivid prawn
#

forward vector of the bone, when server looking at it, it's fine, but when server not looking at it, it's wrong

#

@dark edge an stupid question, I always relay on server, so anything client want to do I always Replicates to Run on server okay, but I never bother with if client get updated, but if server is updated all the other clients will be update too right?

#

so I always do this

#

and Throw function just do what it meant to do

#

Am i doing it right?

cosmic trail
#

Anyone know why a skeletal mesh attached to an actor would be slightly off center of the actor when moving around in Client, but on the server it stays true to the actor's center? A static mesh attached to the actor always stays rigid to the actor's center, but the skeletal mesh seems to be an update behind in its actual world location...though it's attached to the same root.

#

I'm using the regular character movement component

#

It's relatively slight, but it results in the skeletal mesh jittering, whereas the static mesh does not

#

Eh weird, after two hours of trying to figure this out I've solved it..I just disabled gravity on the skeletal mesh, what gives..?

#

Actually the jittering stopped, but there's still that subtle lag which makes the skeleton mesh look about 1-2 pixels behind the actual actor's position...

meager spade
#

are your skels replicated?

#

replicated skel meshes do not play nice

cosmic trail
#

no they are not. It's a subtle jitter so it's hard to notice but alongside a static mesh it's more noticable. Would not have noticed if I didn't turn the animations off for testing something else

#

That's why it's just weird, skeletal mesh on an actor whose position is updating very nicely during replication

#

for the 1-2 pixels behind it's just a bit weird but I don't wanna go in the depths of the code to figure it out, the jitter was the real noticable thing, and the gravity fixed that

meager spade
#

only other thing i can think of is if you have the update optimization thing ticked

cosmic trail
#

yep I unticked that, that also had caused a jitter

#

that was the UI, and the actor position was jittering, but once unticked that smoothed it up

#

wait depends on which update optimizatino you're talking about

#

there's a lot..I unticked a network skip proxy prediction on the movement component to undo the UI and actor location jitter

#

I've unchecked all sorts of various skeletal mesh optimization boxes to no avail, I don't think a regular game would notice the 1-2 pixel shift of the skeletal mesh, tho, not with animations playing

#

sorry I'm talking about like 3 separate problems at the same time

slate basin
#

hey I have an object with a variable I'm replicating to the client, if I change the variable and call ConditionalBeginDestroy on the object from the server, will the variable get replicated to the client before the object gets destroyed?

meager spade
#

UB

#

i highly doubt it will

#

i think once they are marked pending destroy, they stop replicating

#

and actors only replicate objects at set intervals

slate basin
#

is there any way to get a variable to replicate before I destroy the object, I want to check the variable when the client's BeginDestroyed is called (or PreDestroyFromReplication, BeginDestroy, not sure which one is the correct one)

meager spade
#

Force a netupdate, and delay the destroy

#

or send a client RPC through the player controller

trail sparrow
#

is there no need to create a session when using dedicated servers & steam? just got started using dedicated servers, and there doesn't seem to be significant discussion about it online that i can find

glad sedge
#

About hosting a server for dedicated; I assume I don't want to build a linux version for my window's clients to connect too. So I'd be looking for a dedicated server via Azure that handles windows, yeah?

#

I'

#

m just playing around, so I didn't want to go hard on something like an EC2 instance or anything

fossil spoke
#

Doesnt matter what the Client is running. Its quite common for Dedi Servers to be built for Linux.

#

Its usually cheaper to run and slightly more performant.

#

But that depends on your services that you use and the game of course.

glad sedge
#

Oh really? huh, how about that.

fossil spoke
#

Point is, a Player using Windows can connect to a Server running on Linux.

glad sedge
#

Yeah okay, I'll stick with my DO build for the moment.

#

Now to dig into a Linux build 8\

#

Does it matter where I install the toolchain? I imagine it would

summer tide
#

Would repnotified variable work in offline as well?

sinful tree
#

If you're hoping the function will be called when the variable is set, yes.

winged badger
#

only in blueprints*
c++ properly doesn't call OnRep server side

dull lance
#

^ you have to call it manually on server

#

so say cpp MyServerFunction() { MyServerVar = 56; OnRepMyServerVar(); }

winged badger
#

yuck tank

#

you proceed with the ugliest possible example

dull lance
#

ofc elmoburn

#

the heavens must burn

sinful tree
#

XD

summer tide
#

Hey Zlo - After you helped me fix the replication issue. The single player seems broken now. lol. It seems PS_Lobby gets the data but i can't access the data using PS_Gameplay.

winged badger
#

single player can't be broken by that, unless you travel a different way

#

or have some check that prevents it from working

summer tide
#

I think i know why - It might be the Transition Map has diff GM than my single GM

#

Unless I don't have to use the same GM for transition level as the lobby

winged badger
#

you can use the same as arrival map too

#

well

#

your transition just needs to have the PS_Base for PS class really

summer tide
#

i c

#

In single player I go from main menu -> transition map -> gameplay level. I have first two GM with seamless travel checked.

#

Mainmenu has PS_Lobby and transition map has PS_Base and gameplay has PS_Gameplay

winged badger
#

you shouldn't have a different flow for SP if you can help it

#

bad UX

summer tide
#

My multiplayer lobby has two many options that not needed for single player.

#

I guess only for single player I could use game instance

#

No I shouldnt do that- that will break my mutliplayer

#

In my log i don't see seamless travel for single player

summer tide
#

I fixed it. Thanks

vital heron
#

What are some efficient ways to send RPC's with lots of floats that represent inputs? So far I got this code which is very inefficient and was wondering if someone can give me tips on sending rpc's.

cosmic pollen
#

That Happens when l have spliscreen off and l dont know why player mesh spawn when even my gamemode class have none

#

basic my blueprint spawn them how can l spawn the player only when join in game

vestal ferry
#

Hey guys, can anyone tell me what needs to be done in order to have the client movement replicated to the server? (client sees server moving but no vice versa) i understand it has something to do with RPCs but not sure exactly how to set it up

#

physics movement not normal character movement, i'm using a rolling ball

bitter oriole
#

@vestal ferry This is a lot harder than you think it is

#

I mean yeah, you can use RPCs to tell the server that you move

#

But physics won't simulate the same on server and client

#

Trying to synchronize them is a fool's errand imho

cosmic pollen
#

How can count players that join in server and if they are more than a number they cant join excect that l want tag players they join with a number etc. player 1 join and he will have number 1 as a variable for using in game

steep terrace
#

hey , have anyone know what my game will connect if I am not tick the "Use Lan" ?

#

If “Use Lan” is checked the session you create will be only available on your local internet. If I am not tick the "Use Lan" , it means available internet so everyone can join the game ?

#

anyone and any where they can join?

vestal ferry
vestal ferry
bitter oriole
#

Normal character movement does not use physics

#

And it's like 50,000 lines of C++

steep terrace
bitter oriole
#

@steep terrace GOG if your game is there, PSN/XBox if your game is there

#

EOS is upcoming, need to integrate it yourself or buy a plugin as of right now IIRC

vestal ferry
bitter oriole
#

If you want true physics movement in UE4 it's a very hard task

#

You would need either your custom physics engine, or accept that clients can cheat heavily

#

(Or accept a really shitty experience)

vestal ferry
#

wow, ok, thanks, so what about normal character movement?

#

how would i replicate that from client to server?

bitter oriole
#

Normal CMC is replicated out of the box

#

There is nothing to do

vestal ferry
#

I see, got it. Thanks a lot for the help!

steep terrace
bitter oriole
#

Sessions are unrelated to the multiplayer architecture

#

They are a service offered by a particular commercial platform

#

Servers, or lack of them, is 100% your responsibility

steep terrace
#

I see, sorry for asking dumb questions as I am very new to multiplayer game.
Does Oculus provide such online subsystem for implementation, so that I can build a multiplayer game running by Oculus Quest?

cosmic pollen
#

can l cast with wigfet in gamemode to take a variable?

vestal ferry
cosmic pollen
summer tide
#

I've a Blend Space 2d that goes from -.5 to 1. I take input move forward connect to server node which multiplies with a multiplier then set the value to movement variable.

#

The replication works. The only issue is that the owning client sees the animation a little faster.

glad sedge
#

Dumb ass quesiton

#

but, on my dedicated server, how the heck do I restart the game

cosmic pollen
twin juniper
#

I have not been able to find a single tutorial that shows how to set up online play. I can literally only find LAN tutorials, Can anybody link me to the correct tutorial for this?

bitter oriole
#

LAN and online is the same thing, except for matchmaking

twin juniper
#

So I should search videos for matchmaking? @bitter oriole

bitter oriole
#

Well you don't need matchmaking until the game works in multiplayer

#

It's kind of a secondary concern

twin juniper
#

I know what you mean, I've been using ue4 for about a year now, I know the complications of multiplayer

#

But I'm a little opposite, I'd rather know online multiplayer before multiplayer replication

bitter oriole
#

That doesn't mean anything

#

There is no online multiplayer

twin juniper
#

I just want to see my friend join my 3rd person template. That is the video I'm looking for

bitter oriole
#

Get your IP address, have your friend type "open <ip>" in console, done

twin juniper
#

and then after they'd have to search for my session?

bitter oriole
#

No, that command is enough to join

#

If you want sessions, you need to set up your game for a particular online subsystem

#

Such as Steam, GOG, EGS, etc

twin juniper
#

Right, so I'm using the steam subsystem and it works, but that's pretty much where every video stops

#

I also have create sessions and Join session

bitter oriole
#

Look into advanced sessions plugin

twin juniper
#

but it seems to only work for lan

#

yes, that's what I'm currently using aswell

#

Maybe I'm doing something wrong, I'll start over I guess

bitter oriole
#

@twin juniper So what is the actual error ?

#

Using Steam has some prerequisites, like two people on separate machines, logged into real Steam accounts

#

And you need to enable Steam in your project config

#

And of course, your session setup needs to be correct

twin juniper
#

@bitter oriole I realize the last time I tried it, I used game session null. I'm assuming maybe that is the reason only LAN worked. oops.
I'm going to test it correctly this time instead of being an ape, my bad.

bitter oriole
#

Yeah, the NULL OSS is LAN only

twin juniper
#

Feelsbad, thank you

slender ginkgo
#

I'm trying to filter packets in wireshark with the help of UE4's "net.MagicHeader 11001010110110110101101001001010" console command (It's apparently supposed to add a magic number to every header of every packet). When I enter the hex value of this string (udp contains CADB5A4A) it doesn't seem to find any packets containing it. Any idea what I'm doing wrong?

elder sable
#

Hi, i'm wondering how is designed the architecture of a multiplayer game that use lobbys. I would assume there is a master server to create lobbys and launch new server process for each game ? Or there is tools to do that with UE ? Thanks

bitter oriole
#

@elder sable A typical lobby could simply be your single-player main menu, with a list of the players in the session, before any server had started

#

A dedicated could then be spun up when the session is full

elder sable
#

How players can join the lobby without any started server ?

#

Or you talk about the game server ?

bitter oriole
#

Depends on what the players actually see of each other in the lobby

elder sable
#

Mhh, just names, but they need to connect to a server to join the lobby, no ?

bitter oriole
#

No

#

They just need to join a session

#

You then fetch the list of players in the session with their info

elder sable
#

Ok so the session system is using a server ?

bitter oriole
#

Maybe

#

Who cares ? It's a service provided by your sales platform

#

Ask Steam how they implement it

elder sable
#

If i want to make a custom server for lobbys i should care no ? :p

bitter oriole
#

Why do you think you need a custom server ?

elder sable
#

Just to know how it works

bitter oriole
#

Well, ask Steam, GOG, PSN etc how they implement sessions

#

On the game development side, there isn't much to know about it

elder sable
#

Mhh ok, thanks

bitter oriole
#

If you need a lobby, just join a session, fetch the list of players in the session, display it in a menu - you're done

#

Sessions could be created by dedicated servers when they launch

#

When the session is full, players would travel to the server to actually play with the others

#

The only thing you need is a service that monitors the player population and starts new dedicated servers

#

And I mean, you don't need dedicated servers, if your game isn't PVP, listen server works fine

elder sable
#

Ok, so i have to make the service myself or there is existing tools for that ? (it s for pvp yes)

bitter oriole
#

I think there are services that do it, but you're probably better off doing it yourself

elder sable
#

Ok thanks !

bitter oriole
#

I usually advise to stay away from PVP and dedicated servers but hey

elder sable
#

Why ?

#

How we learn if we never try 😋

bitter oriole
#

Because you'll be paying for dedicated servers years after your sales have dried up, and you'll need a dedicated team to maintain these servers, keep them up to date, prevent them from being hacked

#

On the client side you'll be spending 50% of the budget into anti-cheating

#

And you'll likely have 5 online players at best

elder sable
#

i just make a simple game to learn

bitter oriole
#

Yeah, that's why PVP is not a great idea

#

Unless it's never going on sale of course

elder sable
#

No it s just to learn and see how it works :)

bitter oriole
#

Cool then

frank birch
#

If I need to disable player input from the server (player is stunned)... how do I go about it? The controller only exists clientside 😦

bitter oriole
#

It does not

#

Controllers exist on the server

#

And pawns have a method to enable or disable input

frank birch
#

do I have to notify the client that his pawn got disabled? or disabling it in server disables it in client? :S

bitter oriole
#

Depends on the game

pine bobcat
#

I would like to create a FPS multiplayer game with around 20 people joining into one session using the online subsystem running on oculus quest, did anyone have any experience on how serious will the latency be? Will 20 players be too much for a game session? What are the factors that will affect the latency?

lucid vault
#

Does anyone know if it's possible to call an RPC on a specific UniqueNetId?

thin stratus
#

It's not, afaik

#

You can only direct it at the owner

lucid vault
#

I'm trying to generate login tokens on the server for Vivox when a user connects with Steam, and then send them the token

thin stratus
#

ClientRPC via their PlayerController

lucid vault
#

I was thinking that it made more sense to keep all of this logic in the GameInstance because it should only run once at the start of the application, but it doesn't seem possible I guess

rich hare
#

Should a cast be called in a UMG function binding or is that too resource intensive?
The cast is attempting to return a replicated array of structs.

#

idk where to put this but im trying to find the culprit to my game's poor networking

kindred widget
#

@rich hare UMG shouldn't have any bearing on your networking. UI should only ever accept player interaction to do things to in game objects, or display information from in game objects that have already had properties replicated to them. Using them like this should disconnect them from most forms of networking issues sans someone spamming input for some reason. Both that point and casting lead this to be a client only problem. Whether or not you cast to get your information depends highly on your setup and what this widget is for. Casting is only bad when you have to factor in encapsulation. If this widget is casting to just one thing and that thing is already in the level or whatever, it's pretty much free. But casting to multiple things in one class, where there's only one of them loaded at the moment, leads to all of those others being loaded when you create this widget, and if those classes cast to things, and the classes that they cast to cast to things, all of this gets loaded in a chain reaction. This is fine if these are commonly used or very small classes. But that is where you actually pay for casting, not in the call itself.

rich hare
#

Thank you, I knew event tick and umg property bindings were similar, I just was trying to figure out the difference between their update frequency. Luckily now I know What casting does with the system's memory.

kindred widget
#

@rich hare There's really no difference between Tick and a UMG binding. They are the same frequency. In fact this is one place where tick is slightly better if you're using multiple bindings, because each binding incurs an overhead just like tick does, but usually you end up with more bindings in a widget and just one tick.

meager spade
#

5 Bindings vs doing stuff inside 1 tick is expensive

#

in our prototype widgets we used bindings, our entire HUD UMG was running around 1.1ms

#

i cleaned it up, removed all bindings, used tick where i had to, and it runs around .13ms

twin juniper
#

what's the most basic way to create a Coop with Host joining?

final meteor
#

hi guys,can someone help me how to set a good replicated linetrace (server side) for a multiplayer shooter?
To be accurate both side?!
thanky

tranquil yoke
#

Hey guys, does unreal handle redirects for HTTPS request. I am hosting an Image on my s3 bucket and while downloading from this from the link, it has libcurl error 35.

twin juniper
#

Hey, got a question

#

why can`t I still move through this rock

#

I did change the colision with functions first but after seeing it didnt work

#

I made it as in default

#

so shouldnt be a replication issue or such

#

but I still cant move through ? ?

#

I tried making it ignore everything as well

unkempt wing
#

Does an AActor's Instigator affect replication in any way? I'm trying to store the firing player's pawn on a projectile to send events back on collision, etc.

steel vault
#

I wouldn't think so. Are you having issues when setting the instigator? I personally do this on my projectiles and haven't experienced any issues.

bitter oriole
#

Should be

#

Try it

bitter oriole
#

The FPS template relies on character, which is replicated, and is the most massive part of multiplayer

#

Maybe weapons aren't though

meager spade
#

nor the arms likely

unkempt wing
dull lance
#

Question on Garbage Collection at the Replicated Level.

I have a system that requires us to manually set the Names of Actors on Spawn Time [Undo-Redo actions]. My question is that if I destroy ActorName_1 on server, then I need to make sure that GC runs before I re-create another object with name ActorName_1.

However, how does it work at the client level? Will clients crash since GC is not manually ran on their end? If so, how do I turn around it/prevent them from happening?

shrewd tinsel
#

doing killfeed with multicast rpc is a good or bad idea?

winged badger
#

@dull lance i would just have a static int running for names and never reuse any

#

just in case

#

exploring a question like that is time consuming

dull lance
#

Okay. I will look into alternatives to syncing GC states 😛

#

what I could do is also have actors get Destroyed in a controlled fashion, and make sure that Undo(s) can only run when both the Clients and Servers have cleared GC

I kind of already have smth like that in place, where objects on bulk get destroyed an X # / frame

#

then have an onRep variable push at the end to force GC locally

winged badger
#

that sounds like fast array job

dull lance
#

I'd just have an integer tbh

winged badger
#

otherwise you'll end up with a race sooner or later

dull lance
#

Since the destruction happens on server only by a pool manager

winged badger
#

ah

dull lance
#

on destruction cycle end, Integer++; OnRepInteger();

winged badger
#

client wont appreciate you replicating an actor that has same name as existing actor

#

however you onrep runs separately from the bunch destroying the actor

#

and if destruction labds second, forcing gc run does nothing

dull lance
#

That is true

#

I hadn't thought about that.

#

Hmm. I could have a separate map with <Name, Pointer> (as the only one that cares about the ID system is the server)

vestal thistle
#

Does anybody know if I've created a multiplayer game, where everything is created for dedicated server and many moves are connected through multicasts. is there a way for the client to become the dedicated server in such maps like a training map? So I don't need to have a server hosting "tutorials" and "trainings"

winged badger
#

tutorial can be standalone, if its not networked

#

client can host the game as a listen server as well

#

if you are connecting everything through multicasts, you should probably start over

summer tide
#

Hey Zlo - were you ever be able to replicate root motioned based locomotion? I found a way to replicate it properly but on owning client the animations appear faster.

winged badger
#

not something i know to solve off the top of my head

steel vault
#

Would bitfield packing only be used in the NetSerialize overrides for structs or would you consider doing it outside of the NetSerialize for instance on a normal uint8 property on your character that gets set to replicated?

#

No I don't believe so. If you want to test joining things over the internet I believe you need to package your game or run it in standalone.

#

If you want to test over just LAN, then editor works for that.

#

Oh, no that is possible. If you create your game with the listen server model, then the player themselves become the host.

#

I'm not really sure what you are asking. If you want to have a server host players, then yes build a dedicated server to host them.

#

Those are two entirely different things. You will need to build a dedicated server for one, and the other will just be the normal listenserver implementation. I've never heard of anyone doing that specifically, but I'm sure if you share a list of matches to join you can probably have the host decide what it needs to do as far as deciding if it's a dedicated server or not.

#

The code difference between listenserver and dedicated can be very minimal to get it working, but I believe dedicated you're not going to want to play animations or sounds etc. etc. It does sound like a lot of unnecessary extra work instead of just choosing dedicated or listenserver.

#

I personally have a listen server setup for now so I can't completely speak to the effects of the dedicated server, but I do believe you can set it up the way you want it, in the same project. Then, when you build your dedicated server from source, the dedicated server version of your game will run on it just fine.

#

Yes, you are correct in that a dedicated server has no client. It's basically a command line prompt running game logic and communicating to connections the same way a listen server would.

#

I haven't myself put one together, but I would assume that if your code works on the listen server then it should basically work on the dedicated as well. Maybe someone who actually uses dedicated can speak to this effect?

vital heron
#

Is this current conversation done? My bad if it's not.

#

Oh ok

#

I just wanted to ask about calling RPC's efficiently. I want to send RPCs to replicate my pawn's movement. I want to send inputs in the form of floats but I am not sure of how to do this without flooding the server with RPCs. If anyone can give me information or tips that would help massively!

steel vault
#

Why are you sending input in the form of a float? Is this an analog stick input?

vital heron
#

Well that was just what I am thinking right now. It is not a analog stick input. I was thinking of like sending the axis from my Move functions

steel vault
#

I'm still confused. Why are you sending an axis as an input?

#

Explain what you are trying to accomplish

vital heron
vital heron
steel vault
#

Ok, well that still doesn't explain much, but let me give you a scenario then. I press W, so I want to move forward. I send one RPC to say move forward. That's it. When I lift my finger I send another RPC to say stop moving or basically Move(Direction) where direction is 1 or -1 in the forward direction of the pawn.

#

Or 0 in the case that you have stopped moving.

#

Now do the same for A and D. RPC to move in a direction relative to the right vector of the pawn either left or right using a 1 or -1

vital heron
#

Thank you though!

#

Is it fine if I @ you with what happens?

steel vault
#

Sure. If you have have issues though I'd just post here and someone will help you.

vital heron
#

Oh ok. Thank you! Online there is nothing about calling RPCs efficiently so this means a lot 🙂

steel vault
#

As far as being efficient, less is more. If you have to call an RPC for input continually due to analog values changing, you can create your own rate at which you send them up and also send them unreliably. There's no real need to start optimizing or sending efficiently though unless you are having serious issues.

vital heron
#

But what you say is a really good idea

vestal thistle
#

@winged badger thank you

uncut atlas
#

I want to shift my main focus from gameplay programming to online/network programming. I know I have to have a thorough understanding of the UE4 networking framework and online subsystem, but is there anything else I should start learning and dive into? I heard of an application called PlayFab that enables developers to connect their games to their online services, but it's separate from Unreal's online subsystem, so that's something I can look into learning. I think I should look into where various companies get their online services from and learn a few of the popular ones. What do you think my approach should be? I'm taking my Networks course during the next Fall semester but I want to start learning stuff beforehand.

Thanks

dull lance
#

My suggestion is to first understand that how you plan the architecture of your application is almost totally different from an offline one, and to try to find as many flaws to your current method of local programming; networked frameworks will punish you much more for those

#

@uncut atlas

uncut atlas
#

Thanks @dull lance

spark steppe
#

Hey everyone, so I'm planning to add player created levels in my game.
i created the level editor and all the needed information is stored in a struct that holds essential information and an array of structs.
The problem is that i need to make the levels players created visible to others and I'm not sure how to do that.
I heard about using a cool free plugin called vaREST to store the information in an online database but i'm not sure if that's the best way to do it.
I would love to hear any ideas thanks.

weak fog
#

I have a very general question, but I've heard there were some changes to networking in UE4.24. Is anyone familiar with these? Specifically, after upgrading our project, we are now getting net corrections all over the place. I've tried isolating as much code as possible, and tried profiling as well, to no avail. I've managed to gather some info here but it's inconclusive. Vague question I know but I'm mostly just looking for some place to start my search here

cosmic pollen
kindred widget
#

@cosmic pollen If you just want one, use GetActorOfClass, not GetAllActorsOfClass. You also really should use IsValid on pointers before using them.

cosmic pollen
#

@kindred widget l need for each pawn that spawns

kindred widget
#

But you're not doing it for each one. You're only doing the last one in the array with what you posted.

cosmic pollen
#

l fix it somehow

#

@kindred widget

sinful tree
#
  1. You probably don't want to do a "get all actors of class" every tick as it can be a very processor intensive command depending on the number of actors.
  2. If you need to iterate every actor, then you should connect your "set epi" node to the "Loop Body" path rather than the "Completed".
  3. Don't go across execution paths with variables like in the below screenshot. Pass the reference you need between events.
cosmic pollen
#

but how l can count the players when they join without tick?

sinful tree
#

The new player pin is a player controller reference.

cosmic pollen
#

player controller is set automatli for each on who spawn?

sinful tree
#

Everyone who joins a game is assigned a player controller when they connect.

#

The reference to that player controller is provided in the event above.

#

If you wanted to keep track of the # of players, then you can add them to an array.

cosmic pollen
#

big thanks

sinful tree
#

If you want other players to see this value, then you need to replicate it to them, which means storing it somewhere like in the game state, and then they can read it from there (as in multiplayer clients do not have access to the game mode)

cosmic pollen
#

thank u l understand it

#

u just solve all my problems

#

event tick is so bad to use it everytime

sage creek
#

hey

#

but when i run the game, TruPrim is set to "Hello" for some reason

meager spade
#

ermm

#

that is printing the default value for a printstring node?

sage creek
#

well the weapons also do not fire

#

and plus

#

it wouldn't be doing that unless it had no other option

silent valley
#

So, given that ChildActor component seems to be broken for multiplayer (if it needs to replicate) do you guys have any suggestions on what to use instead? Anything built in?
Or do we need to write something - e.g. a placeholder mesh which spawns an Actor at runtime (but only on server lol)?

cosmic pollen
#

how can l add widget when my player logins

kindred widget
#

@silent valley ChildActorComponents are largely useless anyhow. All they are really is a component that spawns an actor and attaches it to the component. You can get the same funcitonality by simply putting a pointer to the actor type in the actor you're attaching it to, spawn the actor that the childactorcomponent normally would, attach it to your actor with the pointer variable and set that variable to that actor. This is even the exact same in multiplayer since all you would need to do is do this on the server, spawn a replicating actor, attach it to a replicating actor, and set the replicated pointer to that spawned actor.

silent valley
#

I want to make sure the artists can preview the look without having the Play each time, but I get your point.

#

Like positioning the dynamic chests within a large blueprint actor.

#

Or turrets, etc, etc

lilac creek
#

wWhen i drive my vehicle(as client) it goes a little harsh, like when i turn it isn't smooth, it's like the game is running at 60 fps and the vehicle at 15, probably because server is computing it, how can i make the server put more attention to the client, as the server player in my game will always just hold a turret

bitter oriole
#

How did you implement networking of the vehicle ?

#

UE4 doesn't have vehicle replication out of the box so that's something you did

lilac creek
#

just used it as is

bitter oriole
#

Well then, there is simply no multiplayer support there at all

lilac creek
#

how do i add it in?

bitter oriole
#

Through great effort

lilac creek
#

are these vents running on server right now?

#

or client

#

and what do they need to be running on

#

server?

winged badger
#

all input is always client

bitter oriole
#

What you need is a full movement component that supports multiplayer. That includes autonomous simulation on the client, sending the input to the server, have the server independently simulate the inputs with smoothing, send back the simulated vehicle state, reconcile that on the autonomous client (rollback/replay). Remote clients can play an interpolated version

#

No physics

#

Apparently the newish replication plugin thing has some basis for that kind of stuff

lilac creek
#

ill check it out

winged badger
#

its 2 versions off from being completed from what i hear

bitter oriole
#

Yeah

#

Basically UE4 right now doesn't support multiplayer vehicles

atomic crater
#

[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"

bitter oriole
#

Whether it ever will is subject to many different features - deterministic physics with Chaos, notably

sharp kestrel
#

Can someone help me figure out what's causing a crash?
Reporter says it is an Exception Access Violation, and the last thing in log before the error is StartLoadingDestination to for the map.
There are three clients running in standalone, the host and one non-host can load into the level just fine but the third always seems to crash.

chrome bay
#

Exception Access Violation is almost always dereferencing a nullptr

#

Attach the debugger (to the third client) and it'll break at the problem location

sharp kestrel
#

Can you attach debugger if you're not running a C++ project?

chrome bay
#

Hmm, probably not. But it's pretty hard to find crashes like that without it.

sharp kestrel
#

Okay. I made changes to a couple of blueprints.
Since its crashing directly after loading the map, and this isn't the host, I can rule out gamemode causing it?

bitter oriole
#

Yes

#

Just run the debugger though

chrome bay
#

Honestly without a Callstack or something, it's mostly going to be speculation

bitter oriole
#

You can attach the debugger to the engine

chrome bay
#

Ah great, I've never done it without a CPP project

bitter oriole
#

It doesn't need to be a C++ project

#

You just need the engine debug symbols to make it make sense though

#

And of course being a Blueprint project means this might be tricky to debug

paper lava
#

Is there an event when player controller, player state and game state are all initialized?

#

I'm doing something on beginplay in the controller but sometimes the playerstate is not ready yet

sharp kestrel
#

I believe you can use PostLogin... I think that runs from gamemode, which should be server only.

#

It has an argument of Player Controller (the player joining) which you should be able to access player and game states from if I'm not mistaken.

paper lava
#

I'll try

chrome bay
#

If it's client-side then no there isn't, you have to wait for the actors to replicate

#

Controllers have an OnRep_PlayerState() you can look at

paper lava
#

alright, thanks

paper lava
#

nvm, I'll do it in C++

slim matrix
#

i know instance static meshes aren't replicated but how can i get the server to spawn a instance static mesh on the client

paper lava
#

@slim matrix could create an event dispatcher and assign it on the client

slim matrix
#

so would the server do a run on server function then run on client function to trigger the event dispatcher

paper lava
#

you call the event dispatcher on the server and on the client you bind it to an event that is set to Run on owning client or Multicast depending on what you're trying to do

#

Hey.. I want to create an event in C++ that is bindable in BP.. Is that possible? And could I do it like this? DECLARE_EVENT(ADominationPlayerController, FPlayerControllerInitializedEvent) where FPlayerControllerInitializedEvent extends TBaseMulticastDelegate_NoParams< void > ?

chrome bay
#

use DECLARE_MULTICAST_DYNAMIC_DELEGATE

#

Then mark it as UPROPERTY(BlueprintAssignable)

paper lava
#

thanks

#

Hm, could I just do a BlueprintImplementableEvent? Seems much simpler for what I'm trying to do

silent valley
#

yes

#

or BlueprintNativeEvent if you want a default C++ implementation that is ignored if BP overrides the event

paper lava
#

ok, I just built that but the event doesn't seem to fire.. Is there anything I need to be aware of when calling the event? Or just call the function I declared?

#

oh wait, gotta check if that even fires on the cpp side

#

hmyes, fine on cpp

silent valley
#

I've never had a problem with BlueprintImplementableEvent not firing...

#

check the Log output it will complain if it can't find the function

paper lava
#

hm, can't find anything

#
// .h:
    UFUNCTION(BlueprintImplementableEvent)
      void OnInitialized();
  // .cpp
  UE_LOG(LogTemp, Warning, TEXT("FIRING ONINITIALIZED!"));
  if (bGameStateInitialized && bPlayerStateInitialized) {
    OnInitialized();
  }

https://i.imgur.com/fVr5qzA.png

This should work?

silent valley
#

yep. I'd suggest putting the UE_LOG inside the if statement though :)
if you have editor symbols you can step into OnInitialized() to some degree.

paper lava
#

oh! haha

#

one sec

#

ah.. game state is not replicating

#

there is no OnRep_GameState, god f.. how do you all know when the game is ready? I can't be the only one wondering how to know if the playercontroller is fully initialized

silent valley
#

there's functions on the PlayerController you can override, and also for GameMode

#

depending on what stage you want to know about

paper lava
#

@silent valley which functions? I've looked into the source and I can only find void AController::InitPlayerState() that has if (GameMode == NULL) though so I can't rely on gamestate being initialized there

#

trying to find out where gamestate is instantiated

silent valley
#

on client or server?

paper lava
#

client

#

or server, I could just fire an event

rich hare
#

I was checking my net profiler, and this was a 90 second session between two people in an action game

#

are these numbers "unnatural" per say?

#

i feel that it might be pinged too many times

silent valley
#

APlayerController::AcknowledgePossession(APawn* P) should be called on client AFTER gamestate is initialised

#

but there's a ton of different functions which can be overridden and honestly it's very confusing and you just need to try a bunch of things 🙂

paper lava
#

I did it on ::AcknowledgePossession(APawn* P) now

#

that seems to work

#

thanks!

rich hare
#

perhaps i could provide my netprofiler file and i could get some peer review?

bitter oriole
#

I mean the whole thing shows about 1.5KB per second which is perfectly fine by overall volume

#

The most replicated property replicated 30 times per second

#

It's hard to say anything about it

rich hare
#

there is still some underlying problem and i can't put my finger on it

bitter oriole
#

What's the problem then ?

#

You haven't talked about that part

rich hare
#

if its not replication then it might be rpc's

#

if you're curious i could dm you the profiler file

bitter oriole
#

Look

#

What is your actual issue here

#

Did your Wi-Fi router explode ? Got banned by your ISP ?

#

Gameplay problem ?

rich hare
#

My internet is fine, but for some reason testing anything with a total ping of around 50-100ms feels like 300+ ms

bitter oriole
#

How are you testing the 100ms ping ?

rich hare
#

I either test with someone over steam or artificially inflate with console commands on my own

bitter oriole
#

So which console commands did you use and how did you measure the response time in the game itself

chrome bay
#

If you want to test with latency I recommend using an external program too, like Clumsy

bitter oriole
#

The built-in packet lag can be confusing, so it's important to be clear about what you're doing

rich hare
#

in the editor i use net pktlag and have stat net for information. I understand that I have failed to consider things like packet loss or rollback situations

bitter oriole
#

So first off - pktlag is not ping, it's lag

#

100 lag means 200 ping

#

Plus the frame time for the server

#

If you're running at 30fps, 100 pktlag gets you close to a 300ms overall response time for the mouse-click-to-video-response time

rich hare
#

so it's not "hold the packet for x extra time" but "increase lag by a factor of x"

bitter oriole
#

No, it's exactly what you said

#

Except I'm guessing both server and client are doling it

#

PlayerState class has a ping value that is accurately measured, you should be using that to confirm which ping value exactly you are physically getting for your experiments

rich hare
#

ok got it. is there a github repo for clumsy? And do you recommend any other network stress test software?

chrome bay
#

It's handy for packaged builds

#

But it does work for the editor too

#

Hmm.. Player Controller maybe?

#

Or do you want it to be entirely local?

#

It is purely a local thing?

#

You could use UWorldSubsystem if so

#

If you don't need network functionality I'd go with UWorldSubsystem

#

Very handy for managers etc. that share lifetimes with the world itself

#

UWorld is kinda the "map" basically

#

Contains all actors, ticks everything etc.

#

Yeah, and the old one would be torn down with the old world

rich hare
#

you could load load an actor on the client that has replication disabled

chrome bay
#

They have some useful functions like ShouldCreateSubsystem(UObject* InOuter) which you can override to limit to certain worlds etc.

#

I've overridden most of my world subsystems to only be created in Game worlds for example (i.e. not the editor world)

#

Ah... kinda is the answer

#

You can totally expose them as a Blueprint you can make a subclass of, but you need to make sure your override stuff like ShouldCreateSubsystem() etc. to make sure you don't get both the C++ one and the Blueprint one

#

By default it'll just create an instance of every UWorldSubsystem you have

#

yeah

#

Ah it will still load the abstract ones, but again you can guard against that

#

This is from my base "World Manager" class:

#
{
    if (GetClass()->HasAnyClassFlags(EClassFlags::CLASS_Abstract)) { return false; }

    if (Super::ShouldCreateSubsystem(InOuter))
    {
        if (InitializationMode == EHT_WorldManagerMode::WMT_NonDedicated && IsRunningDedicatedServer())
        {
            return false;
        }

        // TODO: Don't create if transition level
        const UWorld* lWorld = Cast<UWorld>(InOuter);
        if (lWorld && lWorld->IsGameWorld())
        {
            if (InitializationMode == EHT_WorldManagerMode::WMT_AuthOnly && lWorld->IsNetMode(ENetMode::NM_Client))
            {
                return false;
            }

            if (InitializationBlacklist.Num() == 0)
            {
                // Create if nothing in the blacklist.
                return true;
            }
            else
            {
                // Create if the blacklist allows it.
                FString LevelName = lWorld->GetMapName();
                LevelName.RemoveFromStart(lWorld->StreamingLevelsPrefix);

                return InitializationBlacklist.Contains(LevelName) == false;
            }
        }
    }

    return false;
}```
#

Just with some handy basic settings/enums I've made for it

#

Actually I might just upload this class somewhere, I've found it pretty useful

#

I'll tag you when it's up 😄

winged badger
#

@chrome bay that prevents that extra SKEL_ class from being instantiated in editor?

chrome bay
#

AFAIK... yes. Though I've only ever used C++ subsystems, I've never tried to Blueprint subclass one before

winged badger
#

i did try the blueprint one once

#

but there was extra editor specific instance that was just annoying me too much

#

so i just pulled what i needed from singleton instead and gave up on BP subsystem

chrome bay
#

Where do those SKEL_ / TRASH_ prefixes come from? Is there a specific object flag for it?

winged badger
#

not sure

#

i knew, but i forgot

#

not entirely sure editor would work proper if you prevented them from being instantiated either

lucid vault
#

I just discovered a REALLY strange bug.

  1. Create new blueprint with static mesh component 2) Set static mesh as root 3) Set replicates true for actor and static mesh component 4) In BeginPlay of character, add switch authority and spawn this new blueprint 5) Attach spawned blueprint to mesh component on any bone with SnapToTarget

Now, on the server and every client, that newly spawned blueprint is attached to the characters hand. Works well.

However, if you change the scale of that blueprint's root component (static mesh) so that it differs from the SpawnTransformScale, all of a sudden, the attached actors are no longer replicating to any of the clients

#

Actually, the blueprint DOES replicate on the clients, but it's location is WAYY off

#

I've re produced this multiple times, there's definitely something weird happening with the engine

#

4.26

surreal plaza
#

I am going through some pretty extensive tutorials for multiplayer and want to level set for a moment. Currently I am going through exercises to remedy rubber banding through client side prediction until the server returns the actual location. The idea being that we roll back if there is a difference between the two. Is this the going standard for how to do this still (by hand I mean) and is that something you still worry about when use are using built in FPS characters?

weary badge
#

Hey,
I'm having an issue...
Inside the comment box, Im setting an array with player data. When I print the values, it show the values that are inserted, which is good.
BUT below the comment box I'm trying to get the data from an Index, but it doesn't read the value that it's supposed to ...

Can anybody help me ?

dire dragon
#

Hi! Does anyone know how i can play animation for one player?

#

*ui animation

gaunt apex
#

Hey guys - I got a problem - I want to receive a variable from Server to Display in a Widget: e.g. PlayerID - demand via Function - raise by one on server and receive

#

someone got a clue?

thin stratus
#

Either mark the Variable Replicated and use a ServerRPC

#

Or use a Server RPC and then a Client RPC

#

Functions can't do that, only custom events.

gaunt apex
#

ty will try

dire dragon
#

Hello does anyone know how i can launch character in multiplayer?

thin stratus
#

You mean via the LaunchCharacter node?

dire dragon
#

yea

thin stratus
#

Just call it on Server and Client

dire dragon
#

So i have to do two custom events?

gaunt apex
thin stratus
#

ActivePlayers for example

gaunt apex
#

ok and then an event in the widget to run on server with incrementing the variable right?

dire dragon
#

Somebody help?

#

?

steel vault
#

Has anyone ever used or have experienced with a UTimelineComponent? I was running through a scenario where I was setting up a bunch of FTimelines, and I stumbled across the fact that UTimelineComponent has an OnRep callback. Anyone know if this component replicates if set to replicate in UPROPERTY?

bitter oriole
#

All components replicate when set to replicate

#

But yes it has replication support beyond that

steel vault
#

When I create one in code on my character, I go to the viewport and click on it and the details pane is empty. I assume that means if UPROPERTY(Replicated) makes it rep, then everything else just works out of the box? The claims for the BP check box is that the timelines will be in synch across clients.

steel vault
# bitter oriole But yes it has replication support beyond that

I dove deeper into the component itself and they are using UPROPERTY(ReplicatedUsing=OnRep_Timeline) FTimeline TheTimeline. Which I am fine doing instead of using the component. I'm just confused though as I don't see how this does the same thing the blueprint version checkbox says it should do: "If active, the Timeline animation will be replicated across clients."

bitter oriole
#

I'm not sure what you're asking

steel vault
#

I'm trying to find out if I can just use a Replicated FTimeline to play animations across all clients simply by declaring the FTimeline as replicated.

#

Because the BP version claims that is all it takes

#

It would be extremely nice to just play the timeline animation once and have it replicate

#

Per epic: Timelines must have replication enabled via the Replicated option in their properties. This will replicate the server controlled play position, rate, and direction to clients. This is a basic implementation that may evolve as needs change. Most timelines will not need to replicate. Like any replicated gameplay object, replicated timelines should only be directly manipulated on the server (start/stop etc). Clients should only look at the replicated play positions but not attempting to alter the timeline themselves. In between replication updates, the client does extrapolate play position.

#

But to me, there is no bReplicates on the FTimeline so I'm quite confused

bitter oriole
#

FTimeline is a dumb struct

#

It's never going to have a replication flag

#

The component does

steel vault
#

But the component does not. There is no option to set a replicated bool to true.

#

It simply automatically UPROPERTY(Replicated) the timeline on the component, but I'm unsure how that's replicating the rest of the information you would need.

#

It seems very black boxy to me and I'm trying to figure it out

bitter oriole
#

I mean, you could start with the doc, tick the replicated bool on the component and see how it goes.

steel vault
#

I was trying to keep everything in code instead of creating the timeline in the viewport because I need access to the timeline in C++

bitter oriole
#

Component->SetIsReplicated(true)

#

Though now it's SetIsReplicatedByDefault IIRC

steel vault
#

Ok. Now I feel stupid. It is just a dumb struct, so by setting an FTimeline to replicate it essentially replicates all of the properties that aren't set to notreplicate.

bitter oriole
#

Yes

steel vault
#

Cool thanks for rubber ducking with me 😂

peak star
#

@dire dragon where are you calling the server rpc from?

#

Mine dont work either unless it comes from an actor that owns a network connection to the server, such as a player controller

grizzled stirrup
#

I've noticed that when seamless traveling from one GM to a different GM with different player controllers, when calling GetWorld()->GetFirstPlayerController() on the client AFTER seamless traveling, it returns the player controller from the previous map

bitter oriole
#

Makes sense

grizzled stirrup
#

Is there any way to get the local player controller that is being used on the new map?

#

Other than the 2nd index

#

Which I'm sure would work but is mega hacky

bitter oriole
#

Which player do you want, the new controller for the hosting player on a listen server ?

grizzled stirrup
#

This is in a non replicated actor on the client btw

#

The new controller for the joining client

bitter oriole
#

You need to wait for the handover to happen and get the controller at that point I guess

grizzled stirrup
#

Ah I see I'm calling GetFirstPlayerController too early

#

In that case I'll probably have to make this actor replicated and just do the server RPC from it

#

Other than calling a server RPC on the GameState from the clientside actor which seems wrong as I've never really seen RPCs being called like that on the GameState really

bitter oriole
#

It's not just wrong, it's impossible

grizzled stirrup
#

You can't get the GS pointer in the actor and call an RPC on it?

#

Ah without an owning connection on the clientside actor it won't work?

bitter oriole
#

yup

grizzled stirrup
#

Interesting, I guess I'll just make my clientside actor replicated

#

So I can directly talk to the GM from it

#

Rather than going through the PC

vital heron
#

@steel vault Thank you. It worked perfectly.

sage magnet
#

hey, anyone has tutorial on multiplayer-replicated head rotation?

lucid vault
#

When my players look around, their looking rotation is set on the server and unreliably multicasted to the other clients. I want to reduce the amount of times that the looking rotation is sent to each client depending on how far away that client is. How would I achieve this? I don't think that multicasts allow me to discriminate like that

hollow eagle
peak laurel
#

I have a question if anyone could answer that would be great... when i start my game in listen server my character on the server will lose his camera and just sit there and cant do anything but the clients will get there cam and will start to move but sit in one place just bouncing forward and then back.... any advice...?

lucid vault
#

@hollow eagle NetCullDistance won't work, as I want the client to receive updates at a distance, but less to save bandwidth. For example, when a client is close to a door, I want the doors rotation to be sent 30 times a second. When he is far from the door, it can reduce to 5 times per second

hollow eagle
#

I didn't say cull distance

#

I said priority

#

read the bottom of that page

lucid vault
#

I see that, although, I was hoping to use exact updates per second, rather than a ratio

hollow eagle
#

Still gives you a starting point to look into

summer tide
#

How can I access players and controllers from level BP?

hollow eagle
#

If there is a specific option for what you want, it'll likely be related

peak star
#

Does it work to replicate SaveGame objects? I seem to have bad luck replicating anything that's not a primitive like an Integer or String

#

or Float

#

(or vector)

cosmic pollen
#

My widget text function doesnt work for all players but for only first

peak star
#

@summer tide Those are actors that are often spawned after gameplay begins in the level, rather than placed in the level, so you cannot create references to them beforehand in your BP graph the way you would for actors placed in the level. Is that the problem you are having?

#

The level blueprint is best used for things that already exist before the level begins.

#

So Perhaps it is better to solve your problem with logic in the actors that will be spawned into the level after it begins play, instead of putting that logic in the Level Blueprint

#

It depends on what you're trying to achieve

#

@cosmic pollen Is it a widget component added to the player pawns, or something else in the level world space, or is it something in the viewport / UI ?

cosmic pollen
#

@peak star widget component adde on player pawns

cosmic sable
#

Hey everyone, i added a sitting animation to my test game and just would like to ask if i am doing this right regarding of replication?
First image: character blueprint setup
(Pressing "Insert" -> Set character blueprint variable "isSitting")
Second image: animation blueprint setup
Setting "isSitting" from animation blueprint to the value of the one inside character blueprint

#

the animation blueprint one is hooked to the "Animation Update" stuff
EDIT:
Just checked many youtube videos looks like most of them do it the same way or with Animation Montages

So i edit my question: Should i do a pose "sitting" with a montage or like i did it above inside a state ?

cosmic pollen
#

my widget return node doesnt works for others exect the first player cab sineibe geko.

#

help

peak star
#

@cosmic pollen Game Mode only exists on the Server.
If the other players are network clients then Game Mode does not exist for them. You probably will see "Accessed None" errors because of that.

#

I am actually working on this same problem in my current project 🙂

cosmic pollen
#

@peak star ow

peak star
#

this is because Game Mode is supposed to contain the rules of how to win the game etc. And so clients shouldn't be able to access it and cheat

cosmic pollen
#

if l fix it somehow l will send u

peak star
#

OK

#

I mostly solved it on mine too

#

I have GameState tell the other players by replication or multicast whenever that number changes, and then they update their widgets

#

Game Mode does NOT replicate

#

but Game State does

#

Also GameMode cannot multicast because it doesn't exist on clients

#

It can tell another actor to multicast though

cosmic pollen
#

@peak star l used ur way and count on widget not on gamemode with getall->PlayerState->lenght

#

@peak star ty mate

peak star
#

Glad it worked out for you 🙂

#

GameState->PlayerArray->Length is even better

#

That's a built in array of all PlayerStates that have been replicated to that device

peak laurel
#

i have a question im new can some one explain this to me how do i get the one with a circle mine is only showing with the heart widget whats the difference?

peak star
#

@cosmic pollen I also found that GameMode has a GetNumPlayers function that counts all active non-spectator players. You can pass that to a variable or RPC on GameState to inform the other machines what the playercount is, minus spectators if you're using anything like that

cosmic pollen
#

@peak star intersting but for now l will stay with playerstate 😄

peak star
#

@peak laurel Looks like you're referring to a Class of the widget (the definition of what all widgets of that class should be like) and not an actual live instance of the widget that has already been created. This shows up as a purple pin/wire in BP.

#

That's why the input pin is purple and the return value pin is cyan. The cyan one refers to the actual object that gets created based on that class. Then you can do stuff to the object now that it exists, and it should be the heart icon if you used a Create Widget node

#

If not then you might need to cast the cyan pin to a User Widget first.

#

Gotta go. Past my bedtime

peak laurel
#

ok thanks! have a good night sleep!

#

@peak star

summer tide
#

Is there any tutorials on how to make root motioned locomotion using anim montages for multiplayer project? I'm having trouble smoothly running the walking/ running montages when I press a key

rich hare
#

god the replication for ue4 is horrendous

#

I've used this system for 2 years and I think its reaching my breaking point

signal lance
#

roll your own networking solution then 🤷‍♀️

vestal ferry
#

Hey Guys, i have set up a listen server and have an input problem for my character, to debug it - i put an event tick with print string on the character to see if it even, when the server connects it can move and the event tick prints the string, but when the client connects it doesn't recieve input and the event tick doesn't fire, any ideas to where to search for the problem?

sudden lagoon
#

Hi Guys do you know how to Scalable Servers , Advanced Matchmaking , Anti-Cheat System and Database System in ue4 without that overpriced plugin in the epic games store . You can take time to give me an answer . If you can answer plz DM me .

cosmic pollen
#

l have create 3 mesh that want change matierials but clients only doesnt remeber previous players materils and they dont change either

only the one who will join after them

silent valley
dry zodiac
#

Hey guys! I am having trouble with advanced session. I have two problems;

  • I can't join a session.
  • Also I did not receive anything after invitation. Only I can see from steam overlay friend chat. Show friend UI doesnt work also :/
    Do you have any idea? Thanks! 🙂
twin juniper
#

Anyone know why this doesn't deal damage when it's running on server?

lusty sky
#

@twin juniper i'm not sure if you can apply/cause damage from null source/causer or null damage type
but how are u getting the damaged actor and control variables ?

also does your damaged actor implement OnAnyDamage?

twin juniper
#

@lusty sky I have been ripping my hair out over this, I found out this is only failing to work on dedicated servers. Damaged Enemy isn't returning anything and the method I use to get the damaged enemy is by collision overlap

#

Someone in the unreal forums said "set "Mesh Component Update Flag" to "Always Tick Pose and Refresh Bones""

#

That seems to work for everyone. But I don't know where that is, and I can't find it

lusty sky
#

i think i did it in some testing projects where i add impulse to an actor and when it hits a character it deals damage to the character
it works on dedicated server i did it like this, it should be same idea with box collision when player enters that box :
Actor that will receive damage :

#

@twin juniper

#

the wires are messed up i was just testing it lol

twin juniper
#

No problem I understood it, I'm going to try to

#

I set up my collision this way

#

I'm going to try it your way and see if itworks

dire dragon
twin juniper
#

I'm pretty sure you don't need switch authority there

dire dragon
#

ok im try delete switch authority

twin juniper
#

just call the server dash

#

and then the regular dash

#

you don't need dashevent client only

#

just call dash

meager spade
#

@dire dragon hmm

#

why a server rpc and a client rpc, when its originally on client?

twin juniper
#

^ that's what i'm saying

dire dragon
#

but if i delete dash event client only then server Client when dash it try to move but it goint back

meager spade
#

Action Dash -> Dash -> ServerDash -> Dash

dire dragon
#

ok im try

#

nope it doesn't work my player try to dash but going back

meager spade
#

show us your nodes

dire dragon
meager spade
#

delete the last dash

dire dragon
#

(dash event is my dash)

meager spade
#

show me your dash event also

dire dragon
meager spade
#

what is Moving Right and Moving Left?

dire dragon
#

my axis

meager spade
#

server will not know them

dire dragon
meager spade
#

so your server event needs to know the final launch value

dire dragon
#

ok but i still don't understand

#

cuz im noob at blueprint

meager spade
#

server does not know your input axis

#

only local player

#

you can make this simple

dire dragon
#

But Server player can dash

#

only client server cant dash

meager spade
#

but its still wrong

#

do this

#

have your Dash Event return the final dash vector

#

then modify your Server Dash to call Launch Character with the passed in Dash vector

dire dragon
#

so i have to add output to my function?

meager spade
#

so you end up like this

dire dragon
#

ok im try

meager spade
#

the value you place into launch character

dire dragon
#

ok i have another question... How i can do play UI animation after launching character

#

?

meager spade
#

that is very specific

#

but UI is always local

dire dragon
#

really?

meager spade
#

yes

dire dragon
#

um you know where i can post ui problem?

#

cuz my animation doesn't play 😦

shadow iron
#

Say I have a login function in Game Instance to validate users - is it a bad idea to put the players load and save inventory in game instance as well?

dire dragon
#

Hi! anyone know how i can play animation in function in multiplayer

#

?

#

anyone 😦

lucid vault
#

I have a blank character and replicated movement enabled. This is what my tick looks like:

#

This should rotate the character fully in 4 seconds

#

And it does, on the server

#

However, on clients, it takes exactly twice as long. 8 seconds for a full rotation

#

Why is that? The server is somehow messing with my client rotations, and I can't figure out how

#

(use controller rotation yaw is disabled)

#

Obviously, disabling replicate movement fixes it on clients. There must be some type of default replication functionality in replicate movement that is killing me

dire dragon
#

Hi! anyone know how i can play animation in function in multiplayer ?

elder sable
#

With a seamless travel, do i have to copy the player state data manually ?

sudden lagoon
#

how do we use Epic Online Services with unreal engine 4

#

since there are no videos on it

#

I 'm asking you

split siren
#

@sudden lagoon Why are you asking me? I don't know..

sudden lagoon
#

I am asking every one in this server @split siren

silent valley
mild trout
#

what's the proper way of replicating a character's controller rotation?
I'm doing a twinstick shooter game and I'm having trouble replicating the client's rotation because the Controller is null.
any tips? thanks!

split siren
#

@mild trout Controller exists only on owning client and server. ClientA cannot read ClientB controller

mild trout
#

going to my list of things to remember about replication

#

so should I just do a regular Server call to change it's rotation?

#

RepNotify sounds like an alternative too...

split siren
#

Clients should never have access to each others controllers, so maybe putting a replicated "ControllerRotation" in your character class might be a way to go. But you probably have to give authority to client over that variable, but that is too advanced for me.

mild trout
#

alright, will give it a try. thanks

cosmic pollen
vivid seal
#

running into kind of a specific problem with movement speed changes.
i have a "Stats Component" that handles any stat changes from buffs, including movement speed/gravity/jump height. Currently, I am only applying buffs to things on the server, and then replicating a struct representing them for UI display and cosmetic effects.

This prevents me from easily predicting movement speed changes. If I want to sprint, I'd need to tell the server to activate my Sprint ability, and while I can do client prediction of cosmetic stuff (speed lines, animation, etc.), my speed wouldn't actually change until the server activates the ability, applies the buff, the buff changes my speed stat, and the speed stat replicates down to the client who then adjusts the CMC's max walk speed variable.

#

I don't want to change the buffs/stats system as it works great for everything that I don't need to predict (damage/healing/etc. stats which are only used by the server)

#

but I also don't want stuff like sprinting to be unresponsive. On top of that, I do get a bit of jitter if the server sets the speed before the client since I'm not going through the CMC's custom move setup on the client first

dim briar
#

hello..( Dedicated server ) How can i check player disconnection or if he quit application ?

#

I have database with Online Offline status of players...... but I dont know where to set player offline status.

wicked lodge
#

Hello, I'm having issues replicating bone rotations, at the moment I've got a Blend space with my animations, then in my animation blueprint I got Transform(Modify)Bone to allow the player to reach out and grab items, my issue is that while the blend space animations are perfectly synced, I can't quite figure out how to sync the Transform(Modify)Bone across clients

dull lance
#

Question on Performant ways to use FastArraySerializer:
What is a recommendable way to reduce the querying in order to find which item we want to modify?

My setup is the following: In my application, users will spawn (and can delete with undo/redo) actors over and over. They can select up to all of the selectable objects and then modify things like their transform etc. I was thinking I could store an integer inside the selectable items with their respective Array index, but that would mean that I would not be able to remove array items when objects get deleted. Given that users might create thousands of objects in a single session (undo/redo systems would find which index that id belonged in so it's only about new objects), I would prefer to not have 5k+ length arrays [and growing] after some session time.

If I don't do that however, it'd mean a lot of looping through to find their respective item. If I have 300 items selected, it'd mean looping through the array 300 times to find their respective item.

I could also do also do it by compartments (Say arrays of size 100) and then store inside said object which array chunk they exist in.

Any suggestions?

dull lance
brave solar
#

Can you run a behavior tree on clients individually? For example an NPC in a game that everyone can talk to independently

lost inlet
#

the server usually does this

brave solar
#

Can the server handle multiple clients interacting with the same AI simultaneously?

lucid vault
#

How can I disable character rotation replication whilst still using replicate movement ?

cosmic sable
sinful tree
#

Why does this happen? I am wanting to create a reference to my custom player state BP on my player controller. Getting my playerstate fails on the begin play of my player controller as it has not yet replicated, which is fine. Instead, I'm trying to get my playerstate's begin play to notify my controller. I am validating it is not a server so that this code will only execute on the client version. I call an event on my player controller to let it know it's ready (the Player State Created event)

However, on my player controller, when attempting to get my player state, it still returns value of "None" and breaking subsequent calls to it, even though the event that triggered the call to get the playerstate was fired from the playerstate?

#

Here's what's in my player controller receiving the event and the foreach loop at the end is failing (ignore the other exec path coming up, it's not in use)

#

The one way I seem to be able to get around this is by doing something silly like this (which loops the invalid once)

summer tide
#

Hey guys any idea why this doesn't work. If I have two horses, one enters the water then it's fine. When the second horse enters water, it appears the the physics volume stops working for the first horse.

foggy viper
#

hey guys - does any one have any videos or online resources that explain in detail on how to do a a game server build for linux?

peak star
#

@sinful tree I ended up doing similar because of all the race conditions like player state existing on server but not on client yet so i have timer loops to keep checking until it has everything it needs and count things up on server side by client notifying server. It is probably the wrong way but I havent found the right way yet. I hope whoever gives you the answer lets me know too.

#

@summer tide I dont know. Maybe setting water volume resets the physics or something each time? Why do you need to change it at runtime instead of just having the water always be a water volume?

winged badger
#

@sinful tree @peak star at the point you're calling that the PS Actor was just constructed on client after replicating

#

the engine would proceed to resolve NetGUIDs immediately after that

#

the ideal way to do that is to use a bit of c++ and override the OnRep_PlayerState in the controller

#

(at the point where you're calling that your PC has a valid NetGUID for the PS, and PS exists, but the code to resolve the NetGUID into a reference hasn't executed yet)

marble gazelle
#

Hey, how would you create a door, that per default is closed for each client. Then a client can open and pass it, but, for the other clients the door is still closed, and they can't pass it. I tried some approaches, like have collision enabled on client, but disabled on server and there just use a trigger to detect an overlap and then reset the clients position, but this looks bad. adding the involved actors to each other collision components to be ignored also doesn't work here.
Does anyone of you has an idea how to do that, aside from adding different Collision channels for this?

marble gazelle
#

The first approach that works for me would be to create a second collision channel and add a trigger volume around the door and when the player enters the volume and a condition mets, I change the channel to this second channel and on leave I remove it. this way I just need one extra channel for all doors.

peak sentinel
#

net pktlag=200 is not working for me anymore, is it changed? I was editing config files in order to simulate lag but saw this on answers, it was working before but not anymore with 4.26

#

I am trying to debug a movement replication system so on each change editing config files and restarting editor kills me

#

Actually even config files doesnt work...

#
[PacketSimulationSettings]
PktLag=200
PktLagVariance=0
PktLoss=0
PktOrder=0
PktDup=0
distant talon
#

For "initial only" replicated variables, does a player joining the sever after the replicated actor already exists get an initial replication for that var?

edgy sedge
#

Anyone got any tips for gracefully recovering from a lost connection? Don't care about reconnecting I just want to throw the user back to the main menu without the client freezing. Tried hooking SessionInterface OnSessionFailure and Engine OnNetworkFailure, the latter gets called but if I try to navigate away it just throws a fatal error

Edit: Answer was to use GameInstance's ReturnToMainMenu instead of my own logic, in both of those events.

karmic briar
peak sentinel
#

NetEmulation.PktLag = 200
NetEmulation.PktLag 200

karmic briar
#

i think so

peak sentinel
#

I see, still not applying lag, prorably I broke something else then. But at least I confirmed I was using wrong command. Thanks again

loud mountain
#

can one replicate TSet<> or TMap<> these days?

edgy sedge
#

I don't believe TMap can be

bitter oriole
#

Neither can

#

Not unless you do it yourself

elder sable
#

When i travel from a map to another, i have to save/load players and game data manually ?

weary badge
#

Hey, can anyone provide help, because I'm honestly out of ideas ...
I'm trying to work with an array of structs, but I can't seem to be able to save them, even though the values can be read properly ...

marble gazelle
#

where is the array stored, is it a UPROPERTY?

weary badge
#

@marble gazelle Can I PM you ?

marble gazelle
weary badge
#

@marble gazelle Where the custom event is, the values get through as I want them to, but when I try reading it in the next line, only the host's values are read

kindred widget
#

You're telling the server to do something, and then a fraction of a fraction of a second later having the client try to read from it?

marble gazelle
#

yeah, the array most likely wasn't replicated yet, but I don't see the call to your RPC, so

kindred widget
#

The replication isn't going to work that fast, specially in real life conditions. If you need to rely on data changed and replicated from the server, you need to use OnRep.

weary badge
#

🤦‍♂️

#

Thanks guys

#

I checked what you said by just putting a 2 seconds delay right before the print

#

and it worked

sinful tree
terse iris
#

ok! i've finally done, it, i've finally gave up on trying to make a door rotate and replicate to all clients by myself. can someone help me out with some questions regarding my specific situation?

#

I've looked at cedrics cheat sheet, i looked at videos that are pinned, but i'm still awfully confused! I've a feeling that something about my configuration I don't quite understand well between replicating Actors using an Actor Component and one mesh that moves, with PlayerController input split to 2: interaction button and axis mapping to move the door "smoothly"

#

My attempt was fairly straight forward when i've set it up:

  1. DOOR implements I_Interactable interface (to interact with it)
  2. DOOR has AC_Door actor component (lets you calculate rotation and player facing direction)
  3. PlayerController on Interact input, interfaces with I_Interactable by Custom event that is Run on server with the event of Interact (which then locks only the Looking behaviour i.e. locking the perspective to face the door and using the axis to move the door)
    4.PlayerController on RotateObjectX/Y input interfaces with I_Interactable by Custom event that is Run on server with the event of AxisInput
  4. Door has DoorRotation Rotator, which is replicated.
    6.Door has the actual Door Mesh set to be component replicated
  5. Door set up to be replicated in class defaults.
  6. Door Implements both of the interfaces from I_Interactable to calculate the door changes and disable looking axis on the player controller

with all of the above - the following happens:

  1. Server moves door, it is replicated to all clients and server
  2. Client moves door - nothing happens, doesn't event move the door on the client

so #2 is the problem. and I'm guessing that the client does not have the authority to send an RPC to run on server, but debugging it, it seems like it does send the RPC correctly. So I'm even more confused. why is the DoorRotation variable on the Door not being replicated then?!

#

Interestingly if i make the events not run on server, the client can open the Door, but its not replicated on the server

#

but that makes sense

#

So my real question, is, how do i make my client to have the ability to signal the server - "Hey! I want to open this door! here are the inputs!"

sinful tree
#

I think possibly you want to set your DoorRotation as an OnRep variable, then on the OnRep function, set your rotation on the door.

terse iris
#

I tried it as well @sinful tree , unfortunately that didn't work - same effect as before - calling it from the client would do nothing to the door - calling it from server replicates to all clients

#

Putting a breakpoint for the interaction on the Actor Component, it seems like when the Client is told to Replicate on Server - it does not do so.

#

I think i need to understand better client ownership. because I feel like I'm interacting with an actor that is not owned by the client - but the question is - should it be owned by the client? If it is, how do i set the ownership temporarily to one client dynamically? and then release it to be the server's?

silent valley
#

Client must send RPC to server to request the server opens it. Server opens it and it replicates to all clients.

terse iris
#

And if it shouldn't be, how do I go about sending events to the server about this actor with my input?

terse iris
#

I feel like i'm missing something 😦

silent valley
#

If you toggle it on the server does it replicate to clients?

terse iris
#

yes

#

it's not a toggle, but yes

#

client -> server does not work

silent valley
#

Client can only send RPC to server if it is the owner (I think)

#

Try putting the RPC on the player controller

terse iris
silent valley
#

Erm I don't know sorry. Maybe some BP specific issue? I only use cpp.

terse iris
#

is there some function you use in C++ where you set an ownership to an actor temporarily? have you ever encountered that?

silent valley
#

Player controller will always be owned by the client

terse iris
#

I figured it out, after days working on this thing - i finally figured it out

#

OMG

#

So when you build a custom event, to make the interaction from client -> server. I had to pass the focused object as you see in my blueprint above.
The thing that was not trivial for me to understand is that since it already runs on the server Focused Object does not exist! It's None. So basically the interaction is being sent on the server but fails silently because it interacts withNone!

The way i fixed it was to change the Custom event that runs on server to have Focused Object sent with it instead of trying to get it from the Player Controller at the time of interaction on the server.

summer tide
sinful tree
#

You don't need the IsValid checks as the Cast nodes basically ensure that already.

#

You probably don't need the Do Onces there either. If you're in a volume and you overlap with another you'd have no change. If you exit the volume then you'd be doing the end overlap function call already.

summer tide
#

Without do once, caused issue. By the way how many physics volume I need to place in the level for multiplayer.

#

If I put one, when the second player jumps in the physics vol leaves from the first player

#

Currently it works in offline mode, if I play as a client, when I try to jump into the water, before it overlaps the char the char goes into falling anim and stays floating above water. Maybe It's not replcating properly.

#

@sinful tree Any idea issue replicating this?

peak star
#

@summer tide it is a strange thing. Volumes are part of the level. The level should be the same on all devices. If it is water for one device it should be water for all of them as long as you do not tell it to stop being water.

sinful tree
#

Well after looking a bit more at it, it looks like you're changing your character's physics volume to water. You should probably create a physics volume created in your scene that's in the place and the size of where you want water to exist. No need to change movement mode or variables in your character's movement component.

#

Only thing is you have that mounted check - not sure how you'd work around that.

rugged scarab
#

anyone know a reliable and accurate way to sync server and client time sub second (millisecond). For a count down timer.

summer tide
#

@sinful tree So I have river and lakes which makes it impossible to place physics volumes all over the places. I wonder if the new water includes the physics volume with the spline.

jolly siren
#

Hm why is this true by default?

meager spade
#

🤷

#

i saw that before, not sure what it does exactly

jolly siren
meager spade
#

teag

jolly siren
#

I don't see why we would want widgets on dedicated server

meager spade
#

unless your doing CDO stuff with them on the server

#

no clue

jolly siren
#

yeah, I'll just turn it off 🙂

meager spade
#

wonders if there will be fallout 😄

hollow eagle
#

It's probably because they know some people are... not great at engineering... and put actual game logic into widgets. Having server builds include widgets by default at least gives them an easier time than stuff randomly not working, and anyone who knows better will find that option and turn it off.

manic cypress
#

Hi all, I want to repNotify a structure, which contains vectors and replicated actors/components references. I properly receive the vectors, but no reference. Has someone an idea ?

Print before : https://cdn.discordapp.com/attachments/779005305408192543/797910620153315328/unknown.png
Print afer : https://cdn.discordapp.com/attachments/779005305408192543/797910635739873300/unknown.png
logs (bottom to top) : https://cdn.discordapp.com/attachments/779005305408192543/797912469603352606/unknown.png

floral tulip
#

@manic cypress reference get replicated in the multiplayer framework, the server is in charge of reference ids

#

you can get a local reference, and should be matched with the server if the reference/actor gets replicated

pallid canyon
#

Anyone have experience with the Oculus OnlineSubsystem? I can't seem to check if my requestdelegate is already active, causing crashes in the editor every second time I test the game

pallid canyon
#

Needed to check if OSS was initialized every time and throw the function into an if statement

winged badger
#

exactly every 2nd time?

lost inlet
#

and in the editor, wouldn't it be using the null oss anyway?

pallid canyon
#

yeah it was every 2nd time. The OSS was initialized every time play was hit, then when the play editor was closed OSS->Shutdown(); was called. When testing the game again OSS was not initialized and needed to be called manually with OSS->Init();

barren patrol
#

hi all, noob question. what is the correct way to create a client-side object that will persist between game sessions w/ a server? AFAIK this will load a new "map" and clean up most of what is on the client.

#

for example, to persist a session token with the platform across multiple games

hollow eagle
#

Extend UGameInstance in either C++ or Blueprint and then set it in your project settings

#

It will be created when your game starts and won't be destroyed until your game ends, and is accessible from pretty much everywhere. Loading a new level won't destroy or recreate it, so you can put data you'd like to persist there.

barren patrol
#

game instance, perfect. thank you!

barren patrol
#

are RPCs always required to be void? or can they return data?

#

only makes sense for a reliable RPC of course...

hollow eagle
#

RPCs cannot have return values.

#

You can, however, have one RPC call another to give a result back

barren patrol
#

makes sense

distant talon
#

I have a component im writing that has a few variables that aren't always needed for every child class, but they need to be replicated when they are needed. Is there a way to negate the perf cost of having a bunch of unused replicated variables on the component? Like a way to disable those properties replication on certain child classes?

kindred widget
#

@distant talon Hmm. Maybe. I do something similar with an inventory component. Are you using C++?

distant talon
#

Yeah, this is a c++ component though i might want to make bp children later

kindred widget
#

What I do, is make the parent component do an if statement inside of GetLifetimeReplicatedProps and use a bool to switch how the parent class sets up the replication of properties. For example, I don't need a player's inventory component to replicate to anyone but the owning client since in my project no one else needs to see the player's inventory. But I use the same component basically on a lot of other objects that everyone does need to see. So I use the bool to determine whether to set the replication to OwnerOnly or normal replication, and in the child class, I just change that boolean. Could probably get away with the same thing to disable some replicated properties in child classes.

#

I haven't tried disabling, just changing how it's replicated, but I imagine that the same philosophy should work.

distant talon
#

huh, handy to know, i do have some bools i can switch with inside GetLifetimeReplicatedProps. Do you happen to know offhand when that func gets called, is it just once after/before beginplay or on a continuous basis?

kindred widget
#

I'm not exactly certain, I've never tracked down the call, but I assume that it's some time near the object constructor. I remember having to create a child class to change the bool for some reason. But it's definitely only one time and long before beginplay.

distant talon
#

thanks!

chrome bay
#

@distant talon It's called on the Class-Default Object, so as long as the properties are set at the class level it will work.

#

I.e, you can't set those flags on an actor component of an actor blueprint for example.

#

You'd have to create a subclass of the component with the properties changed, then use that component.

#

If you want to enable/disable property replication at runtime you can override PreReplication

#

base actor class does this for some properties so you can see that for an example

distant talon
#

Huh, nice. I will also take a look at PreReplication

elder sable
#

Someone has any resource on seamless travel and data persistence (BP) ?

glad sedge
#

multi-cast delegates operate the same way as functions - i.e. ownership ?

#

GameState fires a delegate, but my client (HUD) is the one listening out for it. That won't work, will it?

chrome bay
#

It'll work fine

#

Delegates and functions are very different things

inner nest
#

My fellow multiplayer gurus, i come to you in times of great need.
I'm quite new to networking and im trying to do a very basic first game, more like a test really.
My issue with how do I differentiate between the two players/clients?
I have a very basic set up, just a player controller placing marks/symbols on the screen.

#

The idea is that the other player needs to place their marks on top.
Right now i have ZERO idea how do I differentiate between the two players/their marks?

#

Even something as basic as each player having their own colored marks, right now the replication is working but i have no way of understanding what player places which mark.

chrome bay
#

Depends really, you could assign each "mark" with a Player State for example

#

Using the Player State is the key way to differentiate between different players on a Client machine

inner nest
#

oh thank god i think this is what im looking for, player state

#

How do I go by assigning them a player state? ill google it too of course but as i have you gurus here

#

🙏 🌞

bitter oriole
#

Players already have the player state, you just need to extent that class with your functionality

chrome bay
#

Yeah, it really depends what your "Mark" is exactly. You just need a way to assign a player state to it

#

If you had an actor for example, you might spawn it and assign an "Owning Player State" variable (Server-Side)

#

Players then know who "owns" what

inner nest
#

Mark is just a BP with an actor in.
Where should I do my player state business? In the Game mode event graph or the mark BP itself?

#

that sounds exactly what i want

chrome quest
#

Hello guys, please does anyone know a good plugin/project on the marketplace or anywhere else for a dynamic gravity system that has multiplayer support?
Thanks

twin juniper
#

In this situation I don't need to run "New Round" On server, or Multicast because of Switch Authority Correct?

#

I'm asking because I am not sure if I properly understand when to use switch authority vs Multicast

#

I could probably achieve this same effect by just using a rep notify to determines the amount of zombies, but rep notify is hard

dark edge
#

@twin juniper Gamestate is where I'd do all that. I would start with an enum (Planning and Action)

lunar sluice
#

Where should I store things like Health, Stamina, equipment, etc, if I were to create a multiplayer game with a dedicated server? The GameMode blueprint? From what I've understood, the "GameMode" is the only actor that is server controlled, which means that players cannot cheat if things are happening there. Does that also mean that all calculations like damage should occur in there as well? And then sent to the GameState to replicate it to every client?

dark edge
dull flare
dark edge
#

It really all depends. If health and stamina an equipment are also things on other entities in the world like doors and enemies and treasure chests, then just build a system in whichever way is most consistent.

#

If someone is asking if health should be on the game mode, they definitely shouldn't be messing with GAS lol

dull flare
lunar sluice
#

I'm just trying to wrap my head around all of this 😄

#

It would be a nightmare scenario for me to build everything then realize that I did it wrong and then have to do it all over again, hehe

dark edge
#

When in doubt, use rep notify to do things.

lunar sluice
#

So, is it not important "where", as in, in which blueprint/actor variables are stored? And is it okay to "spawn" and actor of the "actor" class to make line traces and then perhaps "launch a projectile"? etc

chrome bay
#

Data/Function locality is much more important in multiplayer

#

In SP you can get away with any crazy setup

chrome bay
#

In MP you need to think more about what data/functionality is relevant to what

lunar sluice
dark edge
#

It all depends on how your project is architectured, but I like to have healthy on the pawn itself. Typically inside of some sort of component, either a health component or stats component

lunar sluice
#

So variables can be stored anywhere? Should I not worry if I have stored things on the pawns themselves?

dark edge
#

Using league of legends as an example, the player state would hold character level, summoner spells, last hit, kda, etc.

#

The pawn itself would have health, armor, ad, ap, etc.

lunar sluice
#

But where would NPC's store their level, health, etc?

dull flare
#

For me this video helped a lot https://www.youtube.com/watch?v=KsORRtBOJYc to clear things up. Series of 4 videos about networking, explanations are great and followed by examples 🙂

BRY

📹 Part 4 of our replication series unlocks limitless potential with Multicast and RepNotify! In this video, we dive deeper about how Unreal Engine's Actor Replication really works as well as introduce ourselves to a variable replication and how combining the power of variable replication with an event driven design can help us build a multiplaye...

▶ Play video
dark edge
#

The NPCs will be pawns as well.

lunar sluice
#

So NPC's have their own Player State?

dark edge
#

No, that's why you don't put health on the player state

lunar sluice
dull flare
#

By the way, I've been playing with GAS recently for a multiplayer RPG project and I have this question I can't get off my head: why should I replicate every Attribute? It's really network consuming so why not only load attributes when the actor becomes relevant (Net Load), then reliably replicate ONLY movement and abilities (the enum ID) ? -> each client computes damage and update health bar and attributes locally -> attributes won't be directly synced but they should still have the same values as server right?
What would go wrong? Is it about the risk of desync?
And if a player cheats attributes locally, well... it just screws its own instance, server won't be affected

Since I don't know of tutorials / projects that do things this way, I guess other actors attributes would end up desyncing from server at some point or something, but I cant seem to find out what could go wrong

#

Also, do you have any resource about how packets are handled? I mean a place I could find out which/how packets are merged before they are sent (same priority, by reliability status etc) I guess it's not 1 RepNotify = 1 UDP packet

lunar sluice
#

Alright I watched the video. So from what I have gathered, it doesn't really matter where variables are stored and how things are calculated and spawned, etc, as long as it's properly replicated and given the server authority when needed?

chrome kelp
#

@dull flare Once you have both latency and any sort of client authority you will have desync, it's a matter of how much and how you handle it. In general I've found that Unreal's solution to this is to try to do as little client prediction as possible, only doing client prediction where it makes the very biggest difference to how things feel (like my pawn's movement & UI input) and trying not to get in the business of predicting other stuff where latency might be acceptable, such as attribute values.
There are plenty of games out there that use different approaches, but it's probably easiest to do things the "Unreal way" if you're using their systems, otherwise you'll be fighting against your tools.

dull flare
#

@lunar sluice well as Jambax said it actually matters, and I guess your choice should be driven by how you want the actor to be replicated to clients. And the behavior you expect is not to "give" the server authority: the server just has the authority if he spawned the actor (dunno if the difference makes sense).

obtuse moon
#

Hi, are there any caveats when replicating arrays?

#

and what about array of structs?

#

I'm quite a noob in networking

#

and the client sees 0 as the Tiles amount

lunar sluice
dark edge
obtuse moon
lunar sluice
dark edge
#

It would probably fill out the player state and then spawn the character for the player.

lunar sluice
#

Hmm, alright. Thanks for the help guys 🙂

dark edge
#

Good luck. Don't make an mmo.

unkempt tiger
#

did anyone ever network physics sounds?

gaunt apex
#

@thin stratus solved my issue - thanks for your support

thin stratus
#

What again? haha

#

But sure, no biggie

gaunt apex
#

your Networking Compendium was a great help finally

thin stratus
#

Ah

pallid mesa
meager spade
#

IsNetRelevant will be called everytime that actor is considered for update

#

Server needs to see if its supposed to be relevant or not for that viewer

pallid mesa
#

yeah, that I know haha

#

but I would like to modify something tagged constant

meager spade
#

i mean repgraph will help

#

cause it splits the level into a spatial grid

#

and you can pull actors only inside tiles that are relevant for you

#

that was one of the main reasons they made repgraph

#

so they didnt have to ask every actor if they are relevant for that player

pallid mesa
#

well I have relevancy sorted already

#

that's done

#

however I would like to reduce the netupdatefrequency for the distant actors

meager spade
#

yeah repgraph wont call IsNetReleavantFor

#

if you use that

#

you would need RepGraph and a special node

#

to handle it

pallid mesa
#

oh okay, so the netupdatefrequency stuff needs to be done in the repgraph yes or yes

meager spade
#

well it still uses the netupdate frequency

#

but it wont do IsNetRelevantFor

#

and it will only show actors that is in your area

#

iirc

pallid mesa
#

I don't know if you are understanding me completely, but relevancy is sorted, I only want to reduce the net update frequency of the distant relevant actors

#

thresholded by certain distance

meager spade
#

yeah but how can you do that? how will the server know that those actors are far behind and dynamically reduce it. You could possibly do it with some engine changes, but you can't go modifying the actors, so it would have to be done on a per connection basis

#

is your IsNetRelevantFor expensive to run then?

pallid mesa
#

not much

#

it's reasonable

#

but within the same iteration space

#

I could grab the viewtarget and set a minor update frequency

#

however I can't as its constant

meager spade
#

and that would affect other clients

#

as your modifying the actor itself

pallid mesa
#

the instance

#

it would be per instance bases

#

thats what my iteration space ensures

meager spade
#

yes but say you modify B's instance, A is close to B and C is far away, if you modify B's update rate, then A would see updates less cause C is far away and reduced its update rate

pallid mesa
#

Oh my god, how didn't I think about that?.... lmao

#

so... isn't there any method to change the update frequency a local player gets from a simulated proxy?

rose egret
#

why u want to reduce NetUpdate based on distance ?

#

maybe GetNetPriority is what u r looking

pallid mesa
#

I don't want to change the netupdatefrequency now that kaos bonked my head

#

I do want to change the update frequency a local player gets from a simulated proxy

#

i'm looking at client perception to reduce the amount of bandwidth that gets sent to a specific client

#

so... imagine netupdatefrequency would be contextual to a pair of clients

#

I do want something like that

rose egret
#

u can send compressed data to decrease the precision its like reducing NetUpdateFreq, for instance sending the Yaw as a byte instead of a float

warm tide
#

trying to run a ue4 dedicated linux server on aws but the logs from the server seem to stop after "LogNetCore: DDoS detection status: detection enabled: 0 analytics enabled: 0" print out and the server doesn't load into the server map but the server loads fulling when I run on my local machine "LogInit: BSD IPv4/6: Socket queue. Rx: 262144 (config 131072) Tx: 262144 (config 131072)" should be the next log output so it could be hanging on this step any idea what the cause is?

pallid mesa
#

ie: significance manager

silent valley
#

I saw the convo about testing. @chilly mason if you're around, can I ask did you ever do multiplayer testing via Gauntlet?

chilly mason
#

yes, but probably not the way you'd think

silent valley
#

I experimented with Gauntlet, but I dont have source build so I was trying to use the built in Gauntlet DefaultTest class. This allows me to launch a server and some clients, but no obvious way of passing arguments into the clients/server.

#

I have written some Functional Tests (launched via -ExecCmsd="Automation RunTests Blah" ) but cannot figure out how to tie the two systems together. How do I launch stuff from Gauntlet and execute the tests on the instances?

chilly mason
#

my game's multiplayer is not based on the ue4 client/server model

silent valley
#

ah yeah you have the lockstep deterministic setup

chilly mason
#

correct

silent valley
#

running unreal tests still seems to involve invoking the Dark Arts

chilly mason
#

you can just call different tests that all have their own parameters can't you?

#

via -test=YourTest

silent valley
#

hmm perhaps... and pass it via Gauntlet by using -clientargs="-test=YourTest"

#

I think I need to restructure my code a bit - at the moment when I run a test it loads into the FrontEnd, executes a bunch of code, then after a few seconds starts running the tests (which load other maps etc).
Feel like I need to somehow make it skip the default map...

#

-test=MyTest does not seem to trigger anything on my Game exe

#

in fact, can the Unreal tests even be run on a Game build? I usually run them via UE4Editor-Cmd.exe

chilly mason
#

they can even run in a shipping build

#
cd c:\Work\UE4Source_425\Engine\Build\BatchFiles
call RunUAT.bat RunUnreal -project=Horu -platform=Win64 -configuration=Shipping -test=LargeFleetTest -build=c:\Work\HoruTest\PACKAGED -uploaddir=c:\Work\Horu\Horu\PerfTests
silent valley
#

yeah so that's the Gauntlet cmd line - and you have a C# class called LargeTestFleet right, but what does your gauntlet job pass into the clients on cmd line to run tests on the actual instance?