#multiplayer

1 messages ยท Page 299 of 1

summer nova
#

maybe a lobby level

ivory parcel
#

Ya, SessionSettings->bUsesPresence must be true otherwise the JoinGame dialog from the steam menu doesn't work

golden granite
#

Anyone know why Event Begin Play under player controller is called on the server for every client that connects?

#

EG: If I have server and two clients it gets called three times on the server, and once on each client.

brittle sinew
#

Every object exists on both the server and client, so all the individual PCs get their BeginPlays called on the server

#

If you really only want to do something in a client copy, just check for if it's the server or not

#

And just so you're clear, the BeginPlays that get called on the server don't all get called on the server's PC, each call corresponds to each PC @golden granite

golden granite
#

So server has it's own PC plus one for each client, and the clients only have their own. Which would explain why it's firing three times and that the variable checks are seemingly not sticking.

#

Is the only way to not fire on server per client is to not place under the PC?

brittle sinew
#

Well like I was saying last night, pretty much every gameplay object exists on both the client and server, and tick/BeginPlay run on both

ivory parcel
#

Does the server even get a PC?

golden granite
#

Yes

#

Servers could be a player, not dedicated, which would require a PC

ivory parcel
#

I was thinking of dedicated servers

brittle sinew
#

Yeah the server is essentially a server and a client. I still don't 100% understand how they are separated

#

For listen ^

ivory parcel
#

Ah, so they don't if they are dedicated?

golden granite
#

I understand that Begin Play under PC is called on the server once for itself, and again for every client, but there doesn't seem to be a way to know if you're in a client's PC copy, or your own.

ivory parcel
#

There is

#
    //run checks server side only
    if (rootActor->Role == ROLE_Authority) ```
#

ROLE_Authority means its the server

#

If its not ROLE_Authority its likely the client

golden granite
#

I tried that using the Switch Authority in blueprints

#

It returns true for every event which makes sense because it was spawned on server.

ivory parcel
#

ROLE_Authority == Server
ROLE_AutonomousProxy == Client

#

Well it will always return true on the server

#

but shouldn't return true ever on the client

brittle sinew
#

The role variable isn't exposed to BP for some reason, not sure if it counts proxy as authority

golden granite
#

Which brings me back to where I was saying how do you know if the event is firing from the PC that belongs to the host, or if it is a copy of one that belongs to the client.

brittle sinew
#

Didn't you use "is server" or something last night? Did that not work?

golden granite
#

Is doesn't work, neither does Has Authority.

brittle sinew
#

Hmm, that's odd

golden granite
#

I feel like this is something that should be implemented but isn't yet.

modern fable
#

are you on BPs?

golden granite
#

yes

modern fable
#

so your issue is, even if you add a has authority check it always returns remote no matter what?

golden granite
#

Let's assume there are 3 players, 1 acting as server 2 as clients. LethalClips explained to me that the server keeps a copy of every players PlayerController, which in my scenario would mean 5 controllers in total: 1 for each player, and two copies.

#

If I run IsServer or HasAuthority under Begin Play in the PlayerController it will return true three times, false twice. Which makes sense because the three times are the server host, and the two copies stored on the server.

#

But I don't see any way to know which are copies, and which is the host(player)

#

It may be certain things that are copied as well, as this doesn't seem to be the case for the level blueprint for example.

#

IsServer returns true once, and false twice as expected.

#

Or placed actors even replicated ones seem to be 1 per player.

modern fable
#

are we talking about knowing what controller would be the player hosting the game?

ivory parcel
#

the level blueprint has 1 copy per instance

#

so one for server and one for each client

#

@modern fable Thats what I am getting

golden granite
#

Yes, but the player controller seems to be 1 per client, and a copy on the server for every client. The code in the copy executes as well, and I don't see a way to determine which is a copy and which is not.

modern fable
#

I see now

ivory parcel
#

There is a function for this

ivory parcel
#

Check if your current controller equals that

golden granite
#

Yeah, I just realized what may work.

#

It is true that index 0 is always the client(not copy)

modern fable
#

๐Ÿ˜›

#

soo, guess it's time for me to ask smth

ivory parcel
#

But not sure what code you could be running that the server wouldn't need to know about it

modern fable
#

are 'children components' guaranteed to be in a same order both client and server side?
(in an array returned by get children components)

ivory parcel
#

I have never tested that, but I believe that as long as its replicated thats true

modern fable
#

yup, but given it's the engine itself handling that am not sure

ivory parcel
#

To be 100% sure you could always assign a replicated "id" for each component

golden granite
ivory parcel
#

and just insure the id rather than component

golden granite
#

Here's how you can tell if it's a copy or not.

ivory parcel
#

make sense

modern fable
#

I guess yea

golden granite
#

Also another hackish way that I was trying to avoid is checking the last letter of the controller name.

#

If numeric it's a copy. A clients copy would just be PlayerController and copies woudl be PlayerController1 PlayerController2 PlayerController3 so on

#

But that's obviously not the best way.

modern fable
#

that's a nice one either way tho

rare cloud
#

You can use IsDedicatedServer too

#

this one work, and yes there is some issue with HasAuthority

golden granite
#

I think that concludes my multiplayer woes for the week.

turbid stratus
#

โ“ anyone here had Steam working on a Mac? Just wondering if there are dylibs that need to be copied over to the packaged game (like we have to copy the dlls and steam_appid.txt for a packaged windows build)

turbid stratus
#

got it kinda working (even cross-platform multiplayer works in a BP-only project wtf)

summer nova
#

update on the session stuff i was talking about

#

1 button lan hosting, other button to connect

#

works fine

#

this on NULL

#

didnt even need c++ for that

jolly siren
#

has anyone done a instant hit implementation that has less replication than shooter games? ShooterGame's replicates every Hit/Miss via HitNotify.

#

is that really the best way to be doing it?

#
USTRUCT()
struct FInstantHitInfo
{
    GENERATED_USTRUCT_BODY()

    UPROPERTY()
    FVector Origin;

    UPROPERTY()
    float ReticleSpread;

    UPROPERTY()
    int32 RandomSeed;
};```
#

I think it would at least be better to only replicate the hits

#

And misses could just be a simple clientside trace. No need to make them perfect.

summer nova
#

careful with clientside hit. Its the easy way, but if you dont check that the hit is valid with the server, you will get easily hacks

#

maybe send the shot origin and direction alongside some other information, and that way you check if the shot was shot at the target

jolly siren
#

well the clientside tracers are really just for effects anyways right?

summer nova
#

server browser working fine

summer nova
#

basic implementation using blueprint sessions

#

on steam

#

it works

#

very naive implementation, but works

wise depot
#

Hey guys, just wondering if anybody else has had this issue and is aware of any workaround. So i'm working on a dedicated standalone server for a project. The server works fine, i can connect to it using a game client using "open 127.0.0.1:7777".

The game client itself has steam enabled, steam works fine in the game, steam achievements, P2P multiplayer etc.

On the game and server .target.cs files i have:

Type = TargetType.Server; (or .Game)
bUsesSteam = true;

Yet as soon as I use a create session node on the server it crashes. When trying to use a leaderboard function I wrote on the server it appears like steam isn't hooking up to the standalone at all. I haven't got any other steam apps running when trying to launch the server and it should just be using all of the config.ini's from the client as its from the same uproject/.sln. I'm creating the session in my game modes BeginPlay with a create session node from the Advanced Sessions Blueprint in UE4.11.2. I got the same results using the standard create session. Presence is being set to false.

All the log says is:
http://pastebin.com/b00Y5FGS

PS> Sorry for the essay.

proud wren
#

Hey I got a question about optimization. I am making a game that has an ability bar, @stiff wasp help me set that up and I got it working. I was playing around with the networking with help from @stiff wasp and other guy that is not in this discord. I got it so the particle effect shows up for all the players, but I was wondering if I am doing it in the best way. I am using a multicast to send it to everyone, but there is three skills for all the players with a max of four players. And 12 multicasts seems like a bad idea, is there a better way of doing this?

#

any help would be awesome!

rare cloud
#

@proud wren You spawn particle each time energy change ?

proud wren
#

What do you mean @rare cloud ? Every time the player hits Hotkey 1 it takes 25 away from energy and spawns the projectile

rare cloud
#

@proud wren Ok, well you can replicate with RepNotify, each time your replicated variable is receive by client, a fonction will be call.

#

in this function you can spawn particle, and use a non replicated float variable 'OldEnergy'

#

that you set at the end of the function, and at the beginning you can check if OldEnergy < Energy, well player gain energy , well you spawn particle ๐Ÿ˜ƒ

summer nova
#

steam blocks IP connecting

#

at least it does for me in LAN

#

even on the same PC

#

use sessions

#

they arent hard to use and they work well

#

no port opening or stuff

proud wren
#

obviously it would need to be the rep notify function

#

but you are saying put that particle inside of a repnotify function instead of a multicast

#

What would need to be replicated? Energy?

rare cloud
#

@proud wren your energy variable is already replicated

#

RepNotify allow you to do stuff once the client receive it

#

like a OnReceiveEnergy Event

#

here the idea

#

and how you declare a variable replicated using RepNotify

#

Normally a function will be create

proud wren
#

Hmm, let me try that

#

Thanks ๐Ÿ˜„

#

Do I need the switch has authority node?

#

Forget that last question. But how do you trigger the particle now? Should I put the function on the input action?

#

i put what you said in the rep notify function, it only shows up for the server

rare cloud
#

@proud wren You dont need to call it

proud wren
#

then nothing shows up

rare cloud
#

Simply change the energy value

#

Hmm

brittle sinew
#

You're not changing the value?

proud wren
#

i am

brittle sinew
#

Where

rare cloud
#

Input is client side

brittle sinew
#

I see in your second screenshot you're setting the Old Energy value, is that replicated?

rare cloud
#

You need to change value on server

#

You dont need to replicate this variable

proud wren
#

hmm

#

switch has authority node?

#

cause I tried that, but then client can't call it

rare cloud
#

An input event is fire client side only

#

Well you need to send with an RPC "I gain some energy"

#

Server, reply ok guy I will send you the new value

#

Well simply create an RPC run on server

#

And set your new energy value

proud wren
#

hmm, makes since. But wouldn't that call the OnRep function? I only want the particle to spawn if they player uses their ability (IE lose energy)

#

so if the player gains energy it'll call it too

#

right?

rare cloud
#

The engine call the function for you

stiff wasp
#

In that case, you can juse make a check inside the function that says, "if you are gaining energy don't call. Otherwise call"

#

@rare cloud I think what he was saying is if the player is regening their energy, that function will get called again. Not sure what he is talking about, just joined the convo.

proud wren
#

hey @stiff wasp ๐Ÿ˜„ I think what Jack said will work. Testing it out now, also going to setup something to regen the energy to see if it gets called again

stiff wasp
#

aight

proud wren
#

๐Ÿ˜„

#

Thanks!!! I am sure this is way more efficient than a multicast

rare cloud
#

It is :)

uncut kiln
#

Hi, everyone! Is there a way for dedicated server to know when stream level load is complete on all connected clients?

ivory parcel
#

get the client to send an RPC?

glad wharf
#

seems to be the most simple way

#

Does anyone here managed to have VOIP on OnlinsubstymeNull working on 4.13? Seemed to work on my first test (brokin since 4.11) but then it started to don't work again.

uncut kiln
#

@ivory parcel yeah, I thought about it. Just want to make sure that there is no other way

summer nova
#

how does the VOIP work in steam?

ivory parcel
#

I have not made it that far, but you might want to look at the advance session plugin

#

It has functions for blueprints and examples for code

wooden plume
#

Does anyone know if there was a fundamental change in the way property replication happens in 4.13?

wise depot
#

Have any of you had steam working with standalone dedicated servers?

#

i can't seem to get mine to hook up to the steam API

twin juniper
#

Hello,I have created the inventory system and I ran into this a problem. When I Overlap the storage box I need to create the BP_Storagebox class. And set the storage slots to the players inventory widget. The problem is that the server does not know that I have created the inventory widget on a player and therefore when I spawn the bp_storagebox class it always fails.

#

I need that "Main widget" to spawn on server so that I can work with that on server. Any ideasM

#

?

twin juniper
#

So basically I need to get the server know that I created a widget and let the server use it

#

is that possible?

cyan bane
#

Works on server, works on clients 50% of the time, works on joining clients 5% of the time.

#

I'm so frustrated

#

Most of the time what happens is when I AttachTo, the client completely moves the child actor.

#

Apparently OnRep_AttachmentReplication is supposed to handle Attachments automatically, but it's not even being called.

#

All I want to do is weld multiple objects together during runtime. That's simple right?

cyan bane
#

Okay so i narrowed it down. For some reason when the server sets SetSimulatePhysics(true), that value replicates to the client and detaches it's children?

modern fable
#

what's your issue exactly @twin juniper

#

are you expecting repnotify variables' callback to fire on newly connected clients? @cyan bane

twin juniper
#

not exactly... I have inventory widgets and they are added to my main widget. In main widget is also Storage widget... and when I open the storage box on map on server it should spawn BP_storage box and add the slots to players inventorys main widget. But the storage box can not find players main widget.

modern fable
#

so just do an RPC or smth

cyan bane
#

@modern fable I have 2 actors that have SetSimulatePhysics(false), they are welded to each other. I call SetSimulatePhysics(true) on the parent on the server. SetSimulatePhysics is replicated to the client. And it breaks the client child actor.

#

The child actor is no longer attached to the parent.

#

And the child isn't simulating physics either

#

For some reason SetSimulatePhysics(true) on a parent updates AttachmentReplication to equal NULL on clients, then the child actor loses it's body instance.

twin juniper
#

I tried everything... The widget can not be replicated or something..

modern fable
#

is it confirmed to be an engine issue? @cyan bane

#

do an RPC that adds the slots client-side @twin juniper

rare cloud
#

@twin juniper, You need to use an actor to replicate value

#

like your character/pawn or the playerstate

twin juniper
#

It might be because I spawn my bp inventory on server but it is only relevant to owner?

#

I spawn the widget in an actor but it is only relevant to owner is that the problem?

rare cloud
#

I don't think it's only relevant to owner with Blueprint

#

with C++ you can add a condition to replicate only to owner

#

but what do you want to achieve with your Widget ?

#

@twin juniper

twin juniper
#

I spawn the imventory actor on event begin play in character bp... In inventory blueprint I spawn widget. Then I have a chestbox placed in my level and when I overlap them, I need to take the widget and change the values in it according to chestboxs values. But when I spawn the chestbox actor and try to cast to the inventory and then the widget, the inventory is valid but the widget is not

cyan bane
#

It's probably not an engine issue. I'm sure I'm abusing the system somehow. @modern fable

#

All I want to do is attach/weld staticmeshactors to each other during runtime.

#

That also have SetSimulatePhysics(true)

#

I can get it to work just fine in singleplayer and on the server.

rare cloud
#

"In inventory blueprint I spawn widget" this is strange for me @twin juniper

versed thistle
#

Is anyone familiar with Server Replication using pawns? I have a Pawn setup, but none of the movement for it gets replicated on the server... I read that I have to use Characters and Add Input, but a lot of my movement system (very advanced and complicated) uses forces and such... Is there a way to Replicate that? Or is that a bad idea?

modern fable
#

Characters handle movement and replicates it automatically thru their movement component @versed thistle

versed thistle
#

@modern fable My Pawn uses forces to move it around the work... Do I have to use a Character in order to Replicate it on a server correctly?

modern fable
#

depends, do you animate your pawn when walking and so on?

#

if so using a Character is the easiest way to go

versed thistle
#

Well my Pawn is a Drone. So there will be some animation... but it's nothing like all the other basic projects out tthere. It has a very unique flight controller... It uses physics to fly around and such, which isn't currently being replicated.

modern fable
#

so you can set it as a replicated actor

#

it should automatically replicate its transform

#

when moved server-side

#

there's an issue though where some transform values are updated but the actor itself ain't, so beware with that

versed thistle
modern fable
#

is it spawned on the server and where are you moving it

versed thistle
#

So the Drone itself looks like this...

#

As for the server... I followed UE's latest tutorial on multiplayer... and everything works just fine, and I can join other people and vice versa... However you can see anyone elses movement. They just stand in place.

#

And I created a Character as well to test with, and that movement works just fine... So I know it has to be something with the Pawn class and Server Replication... Not sure if I'm missing a step or not moving the Pawn around.

modern fable
#

you are moving it client-side

#

so it's moving locally

versed thistle
#

How would I move it server side?

#

Are there any tutorials out there? I don't think I would even know where to begin...

modern fable
#

call a server-sided RPC that moves it

#

or applies a force and so on

versed thistle
#

I'll look into it! Thank you โค

modern fable
#

โค

#

essentially though,

#

if a controller is possessing a pawn, it most likely is its owner

versed thistle
#

Am I going to have to use C++ for something like this? Or is it a better idea to use C++?

modern fable
#

so you can call a run on server RPC, which is called from actor's owner's end

#

naw, it's good in BPs

stiff wasp
#

I am just now getting here, and I saw "movement on the server". I am just going to turn around and leave

modern fable
#

๐Ÿ˜†

stiff wasp
#

@versed thistle if you know how, do it in C++. You'll get much better performance.

modern fable
#

well you could technically use the same movement component a Character uses, but given he's using forces and pretty much learnin'

#

some stuff like roles ain't properly exposed to BPs too

versed thistle
#

Well I originally used a movement comp but when applying forces to the static mesh... It just wouldn't work. Since it's a child of the collision capsule or whatever. I think.

stiff wasp
#

What is it you are trying to do? GIve me like a 20 word breakdown

modern fable
#

children ain't replicated by default, btw

versed thistle
#

Did you see the screenshots above @stiff wasp ?

stiff wasp
#

no, discord is being stupid for me and won't let me scroll up

versed thistle
#

I'm using a pawn instead of a character... and I use physics to move the pawn around. Currently, its client side, so it's not being replicated on the server... so I need to setup RPCs for it... is my current understanding of where I'm at.

stiff wasp
#

Multiplayer physics in UE4? Hehehehe

modern fable
#

๐Ÿ‘€

stiff wasp
#

Okay, and what is not working

#

just the multiplayer part of it?

versed thistle
#

Yeah, so when I join a server and such, I can see other players, and I can move around, but as they move around as well... They stay stationary on my screen.

stiff wasp
#

Heh

#

Alright

modern fable
#

so yea, he's moving locally

#

that's why I suggested doing RPCs

stiff wasp
#

Eh

modern fable
#

but ๐Ÿ’ฉ

#

you said though forces ain't applying with the floating pawn component cause it's a child? @versed thistle

versed thistle
#

I don't remember what happened when I used a character and floating pawn movement... I might go back and try it again...

#

It's been a while

#

I'm also currently developing on a listen server... however I'm going to move over to a dedicated server in the long run. I'm not sure if that changes anything or not however

modern fable
#

not really

cyan bane
#

@modern fable I think it is an engine bug, now that i experiment more

#

The SetSimulatePhysics(true) still makes client objects to lose their body instances, even if i override OnRep_AttachmentReplication and don't call super on it.

#

So SetSimulatePhysics is replicating something somewhere that's bad.

#

I can't find it though

stiff wasp
#

@versed thistle have you ever looked through the character movement component?

versed thistle
#

A little bit... I'm looking more into it now. I think I'm going to update the drone to use it. I have a concept in mind (:

#

Okay, I think I figured it out with Custom Events and Replicating them... However on the computer that hosts, I can see the other players movements... while in the computer that isn't hosting... I can only see my own movements.

#

But I'm getting somewhere! ...I think

versed thistle
#

I did go through that a bit... Still learning so it's a bit over my head

#

I did a really basic setup to test

#

And the host can see the movement... but client still cant. x;

#

I'm not looking for someone to tell me exactly what to do... I like to learn. But if you want to point me in the right direction, that would be awesome (:

stiff wasp
#

Alright, so you are running everyones movement on server.

#

So of course host can see it

#

You have to send it back to the clients

versed thistle
#

Well actually... I just tested it again

#

And the Client can see both movements

#

But the host cannot...

#

Host as in, the computer that is hosting the lobby... It's still I client to itself, but yeah

stiff wasp
#

uh huh

#

what did you change?

versed thistle
#

LAPTOP HOST

Laptop: Only See's Itself Move
PC: Can See Both Move

PC HOST

Laptop: Can See Both Move
PC: Only See's Itself Move

#

So the computer that hosts... doesn't see the other computers movements. While the client can see all.

severe widget
#

Can a third client see everyone move?

versed thistle
#

Haven't tested it yet...

severe widget
#

Going to guess not- your problem seems to be that the server doesn't actually know that the client moves.

versed thistle
#

The Custom Event is set to Multicast... I'm kinda just trial and erroring right now...

stiff wasp
#

oh boy

#

multicasts

#

i hate them lol

#

don't use a multicast

#

sometimes you have to, but most of the time they are used cause the programmer was lazy.

#

Not saying you are lazy, just saying try to use as little multicasts as you can

#

You want to handle all movement on client, that way the client does not see their character lag.

#

You just then update the server on the character's location and make sure there is nothing stopping the client from moving

#

an example would be if the player is dead

#

if they are dead, than they can't move (shocker)

#

most of that is handled for you in the character movement component, but since you are not using it you've have to do that yourself.

versed thistle
#

Interesting. So I set it to Run on Server... And now when I try to move on the client... It stutters. It trys to move, but ends up being set back to its original location (or rotation in this matter)

versed thistle
#

I think I got it

#

I had to use the node Set Is Replicated on my actor...

#

Maybe. We'll see. -.-

#

Yep! That totally did it.

thin stratus
#

@versed thistle This is a DefaultClass Setting

#

You don't need to use the Node

#

Open the Class Defaults and check for "Replicates" and "ReplicatesMovement"

#

Also, don't use RELIABLE RPCs for this

#

Event Axis Tick, they get called multiple times per second

#

And you don't want to send an RPC multiple times per second without allowing to drop one or another

#

Reliable is more used for things where you want the Player to receive the RPCs, even if it lags

#

The Stutter might come from the simple fact that you tell the Server to Set the Relative Rotation and he then replicates that back to the client

#

So if you still experience a small delay in input, make sure the local client (the one that calls all that stuff and not one of the clients that just see the mesh turning), also set the relative rotation

#

Otherwise he moves the mouse and waits for the server to react to it

#

with a 200ms ping or what ever, this feels really bad :P

wise depot
#

Any ideas why a dedicated session isn't showing up when searching for sessions? (STEAM API)

thin stratus
#

Well, what settings do you start it with

#

And what AppID

#

480 or your own?

#

@wise depot

wise depot
#

using our own appID

#

the settings on the session are:
Public Connections: 10
Private: 0
LAN: False
Allow Invites: True
IsDedicated: True
Use Presence: false:
AllowJoinViaPresence: False
Anti-Cheat: False
Uses Stats: False
Should Advertise: True

#

the server fires off the On Sucess event from create session too

#

does UE4 report to the "Game Master Server"? i'm yet to fill out the steamgames dedicated server information

#

oh wait... i think this may be a firewall issue, apparantly i can't ping the server. well I can ping the server directly, but not on the game port

cyan bane
#

I made a separate project, using shootergame as a template, and remade my issue using blueprints.

rare cloud
#

Correct me if I'm wrong, but input event is call client side only

#

maybe if you use a dedicated server, here I guess one of your client host the server too

cyan bane
#

You're right, however set simulate physics and attachto are replicated

#

I'm only using the input events on the server

#

I didn't make the blueprint for the clients to be able to weld or set physics. Just for simplicity.

rare cloud
#

"The main issue has to do with your Component hierarchy for the Item blueprint. When you set the Body to simulate physics the root stays where it was placed. When you pick the item up it is the root of the blueprint that is attaching to the player."

cyan bane
#

No, because it works just fine on the server.

rare cloud
#

your actor is set to replicated ?

cyan bane
#

the BP_Cube is, the replicated values are in the album

#

Replicate movement is true

#

But that shouldn't matter, simulate physics is replicated, and works on both client and server. The root object falls in both.

rare cloud
#

there is few things strange on your BP @cyan bane

#

you try to attach the static mesh cube to the BP

#

oh you target the first cube

#

and attach to the second ?

cyan bane
#

Yes

#

Which replicates to the client

#

That's why I have the tick calling the draw debug string on the bp_cube

rare cloud
#

@cyan bane Yep well I made a first person template and reproduce your bp

#

the physics is replicate

#

all is ok

#

except

#

rendering

cyan bane
#

What do you mean?

rare cloud
#

I mean you can move attached box with the client

#

when you push both

#

the collision is like ther are linked

#

but the attached box is not rendered correctly

cyan bane
#

They aren't attached though

#

In my draw debug string i have the child output anything it's attached to

#

The server outputs the parent, the client outputs nothing

#

You can see the difference between the first image in the album and the second

rare cloud
#

for me it works correctly

#

the string on the client is correctly replicated

#

I can see attached on both

#

oh no

#

once you set physics, my bad

cyan bane
#

yeah :/

#

You think its a bug? Or am i abusing something

rare cloud
#
// If we are enabling simulation, and we are the root body of our component, we detach the component 
        if (OwnerComponentInst && OwnerComponentInst->IsRegistered() && OwnerComponentInst->GetBodyInstance() == this)
        {
            if (OwnerComponentInst->GetAttachParent())
            {
                OwnerComponentInst->DetachFromComponent(FDetachmentTransformRules::KeepWorldTransform);
            }
            
            if (bSimulatePhysics == false)    //if we're switching from kinematic to simulated
            {
                ApplyWeldOnChildren();
            }
        }
#

Actually I don't know, it's look a strange behavior

#

I will try to add a SceneComponent as root

#

once update to 4.13.2 is finish

cyan bane
#

I noticed that OnRep_AttachmentReplication is called on the client, setting the AttachmentReplication variable to null.

#

Though when I override that in c++, and not call Super::OnRep_AttachmentReplication, the issue still occurs

cyan bane
#

@rare cloud, overriding OnRep_ReplicatedMovement() had a major positive effect. Whatever is going on has to do with that.

cyan bane
#

Ok so I think I figured out what's going on.

#

Before updating the AttachmentReplication variable, the server first sets it to null. And then populates it with new information. The issue is the client detaches the child object from the root object when it gets the onrep call for that variable. And AttachmentReplication is not updated again on the server to reflect the fact that the server still considers them attached.

surreal prism
elder ice
#

Sooo... when the Multiplayer "Number of Players" option is set to 2, does that mean that there is only one actual player in game? It says the editor counts as a player though it doesn't appear to connect my editor viewport as a client.

modern fable
#

editor runs as a listen server unless dedicated server is checked

twin juniper
#

@elder ice Always play in "StandAlone" when you test multiple clients

#

Not PIE

misty stirrup
#

so like, has anyone looked into running large multiplayer matches (300+ players in one servre) on unreal

#

ive noticed that ill have weird physics desync sometimes

#

just in normal multiplayer

cyan bane
#

What kind of physics?

sand juniper
#

Doot doot

late sundial
#

Hey everyone im using SetActorRotation to rotate my actors towards the mouse location although its working on Server to Client, Client to Server is not quite syncing up

#

Does SetActorRotation replicate automatically?

modern fable
#

client to server doesn't replicate

late sundial
#

How would I go about fixing it

slender fulcrum
#

@late sundial you can change replication broadcast types as well as you could make the server authoritive and only respond to input given by the client and then the server distributes the new location/rotational values of that client

golden granite
#

@slender fulcrum I'm also curious about how you would pass stuff like that to the server. I know with a current mp game I'm working on I have to run on server which replicates to client but in a game such as a FPS wouldn't that cause quite a bit of lag?

#

Or would you perform action on client then send to server as non-reliable

#

and hope that other clients see it right.

slender fulcrum
#

@golden granite fps games generally use non authoritive servers, typically udp positional data due toe the speed and reduced header of the unreliable channel

#

@golden granite the client will send keypresses or actions to the server, the server proccesses them instead of the client and just sends relevant data back to the client or all clients

golden granite
#

Some MMOs when you lag out you get stuck in place. I'm assuming those pass through to server first. Others you keep moving but nothing else loads. I'm assuming that's what happens when you let client move freely and pass info to server.

slender fulcrum
#

Yes you can also see it when disconnecting while someone is running like when a server goes down

#

The player will run endlessly

#

Because the clients cant be told by the offline server that the player stopped

golden granite
#

Makes sense.

slender fulcrum
#

It can save on data just telling the clients that a player is moving and then nothing till they stop

#

Instead of constant stream of updates

rare cloud
#

@golden granite Those mmo hasn't client-prediction, because normally you don't stay stuck you continue to move correctly and server will re-set your correct position

cyan bane
#

How do I make it so physics objects only move on clients when replicationmovement data is sent?

golden granite
#

@cyan bane you don't have to replicate everything, and unless the server is the one moving an object it won't get replicated.

turbid stratus
#

Where can I find the Engine version? Apparently I need to synchronize the version between my Mac & PC builds (so that I don't need a separate copy of my project for the mac version)

regal relic
#

Physics simulated objects have their own internal code for replication behaviour. Changing that would be arduous.

#

Probably best to turn the Net priority down on your objects to ensure they dont oversaturate your bandwidth.

pliant cypress
#

hm... for some reason click/touch event does not work anymore in my project for clients. Is there a setting I should check first?

golden granite
#

@pliant cypress Your player controller probably got reset.

pliant cypress
#

@golden granite it was something like that. I have changed how I handle data in my card game, and since there is no more replication involved, client's click's didn't went through. Had to make another stop in PlayerState between the Map and GameMode. Thanks for the reply! ๐Ÿ˜ƒ

golden granite
#

Is there a way for the server to send data to only one client? EG: it's a board game, if player draws a card the server picks from the deck, then only sends the card to that single client to prevent packet sniffing

fresh saddle
#

Quick question, are component objects on the player character replicated? I've been looking at a plugin that costs $80USD and am hesitant on purchasing it as I'm not sure if it will benefit me on my project. I messaged the creator and he said he wasn't sure as he hasn't tested himself

regal relic
#

@golden granite Yes RPC (Custom Event) replication Owning Client will send it only to the owning client.

golden granite
#

@regal relic Ah, thanks. I'll look into that.

#

@regal relic The problem I'm having is I'm not certain how to store only the deck blueprint on the server, and have clients only receive a new card from the server without them seeing the deck replication.

golden granite
#

While I have no issue replicating to only one client, I can't seem to pull information stored only on server and then send it to a specific client.

regal relic
#

Just make sure any behavior that needs to be server side only are run using rpc call run on server. Only the servers bersion of that data will matter. Any incorrect variables stored on clients is irrelevant. Just dont let them pass their version of variables into the server. Which can only happen if the server actually coded to do so.

#

For any replicated data (classes, or variables) for instance there are two versions. One server, one client. Just never trust the clients version of the replicated data.

#

@golden granite

golden granite
#

@regal relic Yes, but I don't know how to store something on server only, and not replicate to clients. Then have only a single client request that from the server.

#

For example: only server holds deck of remaining cards. client needs a card so request one from server. server modifies deck and gives player card. Other players are unaware of what the player received, and no players know what's in the deck.

#

I can't use run on Owning Client because the client doesn't have a copy of the deck.

#

And I can't seem to find a way to Run On Server, then pass the info only to a specific client.

#

So I only see my options as to replicate the deck then pull from clients deck using Owning Client, or store deck on server and pass PC when requesting a card, then Multicast to all clients and only apply card if PC matches.

#

If that's the route I absolutely have to go I can perhaps seed the value. Have server encrypt value with seed before sending, and have client decrypt with seed.

regal relic
#

You can store data in the gamemode. Only one of those exists, And its held by the server. a Black box so to speak.

golden granite
#

yeah but how would I go about getting that data to only one client

#

From what I'm understanding there's no way to store data on server only, and send to one client only when needed.

#

If you run on Owning Client, client won't see the data. If you Multicast everyone sees it, and Run On Server only server sees it.

#

probably going to end up using multicast and encrypt the values sent

modern fable
#

Work under game or player state, both exist on all clients

#

Just have a non-replicated deck and update it through a run on owning client RPC - so that only the owner receives it

#

Using those would be a better practice, as that's game-relevant data

#

@golden granite

#

or oh!, when replicating an actor you can specify whether it's only relevant to its owner right?

#

so if it's updated server-side, only its owner receives that

golden granite
#

@modern fable GameState only exist on server. But the idea is to not have replication because we dont want other players knowing whats in opposing players hands.

#

Only the server should know what each player has.

modern fable
#

Anyhow, you can do the last approach

#

Think of this, player controllers only exist server-side and on its owner's end

golden granite
#

yes

modern fable
#

You can apply its replication settings to a custom actor, your decks

#

So, replicated + only relevant to owner

golden granite
#

so this is the part that loses me.

#

If I have a deck blueprint all players own it but only server handles it

#

if I have an event in the blueprint set to run on Owner Only it won't run on the servers blueprint, so it wont have the values. Is this wrong?

#

when I say only the server handles it, I mean only the server sets deck values and knows what they are

modern fable
#

So lets say, you have a player owning a deck (so it's relevant to him), lets give that deck a bool

#

If you change that bool server-side, it's not going to replicate unless that variable is set to

golden granite
#

yes

modern fable
#

So you can essentially either have variables replicating themselves and perhaps do a repnotify in case you want to run specific code on every change

#

or do same through RPCs instead

golden granite
#

repnotify goes to all clients though, right?

modern fable
#

Nope, you have the actor set to be only relevant to its owner - so that's the only client it's being replicated to

#

(not sure if the actor is constructed even on other clients' end)

#

Anyhow, lets say that bool is a repnotify

#

If you change it server-side, it only replicates to its owner (relevant) and executes its repnotify function/event

golden granite
#

so maybe im going about this wrong

#

I want the server to know whats in the deck, and whats in each players hand. player(client) should never know whats in the deck, and other players shouldnt know whats in other players hands.

#

so my way of doing it, or the way ive been trying to...

#

is to have the player run a function on the server which grabs a card from the deck, then executes a custom event to only run on the owning client with that pulled card

modern fable
#

In that case, have the deck itself non-replicated (as the client doesn't have to know about it) and then when a player draws a card, modify its 'current hand' value - which is replicated to the owner

#

basically what you do yea

golden granite
#

yeah, so im not understanding how to go from run on server, then to run on owning client

#

because I cant go straight to run on owning client because the deck doesnt exist on owning client

#

thus my dilema ๐Ÿ˜›

modern fable
#

I see now, ๐Ÿ˜›

#

So

golden granite
#

and I feel like theres no way to accomplish that

cyan light
#

who wants to talk about mmog topics? (explictily not wanting to talk about how it's impossible...)

modern fable
#

I guess the issue is more on how to store players' deck and so on

cyan light
#

hm

#

reads the conversation on decks

modern fable
#

๐Ÿ‘€

golden granite
#

the only way Ive thought of to handle this is to run on server then multicat to all clients an encrypted value.

cyan light
#

are you ok with the server knowing everything

modern fable
#

lets start over, where are you handling all that

golden granite
#

eg: client says, hey server..heres my encryption seed...server says: okay... so this is the encrypted value with your seed, and sends it to all clients. then the right client says, okay i have that seed and decrypts it

#

thats not in the coding yet

cyan light
#

What is the problem again?

modern fable
#

how do you determine a player has to draw

golden granite
#

thats just the only thing I can thing of

#

when a player performs his turn he draws a card.

cyan light
#

@distul that sounds like a lockstep floating point sychronization

golden granite
#

its not so much a matter of when to draw but how to only get it to that player without the player knowing whats in the deck

cyan light
#

like starcraft 1 style

modern fable
#

so Gamestate + Playerstate?

golden granite
#

what if.. I have an idea

modern fable
#

I mean, I'd handle drawing on the gamestate and perhaps save players' hand under their state

golden granite
#

PC are on server and client, right? so...

#

what if I set the variables that old cards to replicate in the PC

#

then when a client needs the card it Runs On Server (in deck blueprint), passes a reference to its PC, server matches that PC with its own copy, changes value in copy and it replicates

#

would that work..

modern fable
#

what if

#

You have a Deck actor with two values: cards, hand

golden granite
#

also, Im kind of new to player states. did some reading on them but havent needed them YET

modern fable
#

This actor is relevant only to its owner

#

And only hand is replicated

#

You can have this Deck actor, i.e., under player's state

regal relic
#

Someone had a handy little pdf giving some slides and info all about UE4s replication system.

modern fable
#

orr oh well, that wouldn't be a cards game

golden granite
#

I feel like if I could see an example of relevant to woner only I could work it out pretty quick

regal relic
#

I know there is also a handly little hour and a half twitch stream one of the epic guys did a little while back.

golden granite
#

excuse my typing im on a compact keyboard

modern fable
#

That pdf is pinned here on this channel iirc

regal relic
#

No worries. was on a cellphone the past several replys now.

modern fable
#

Same here

#

So, lets go about this

regal relic
#

Ok so Distul i think most of what your concerned about is actually a non issue.

golden granite
#

just grabbed the pdf btw

regal relic
#

See there multiple version of most classes when it comes to multiplayer the the server version of pretty much everything (minus client only stuff like menus), And then a client version of everything except a couple (mainly the gamemode class)

modern fable
#

GameState -> Player should draw a card -> Draws a card from game's deck -> Calls an owner RPC on PlayerState that updates its hand

regal relic
#

Anyway you never have to worry about the client version of anything, Just the server side version, When it comes to authority.

#

Just make sure a client never gets to act in a global way concerning the server or other clients, And only the server with have authority over anything that happens.

#

For instance you have a deck with card number, and its suit. say you tell the server to generate the array of cards, and randomize them. Since only the server is instructed to do this the clients wont know anything about it.

#

Think of clients as only being able to make requests.

#

The clients requests the server to do X

#

Its up to the server code to decide if that request should be allowed, And follows it out internally not referring to the client again for any extra data.

golden granite
#

okay so think I understand, let me type out an example

regal relic
#

The server is like the dealer. The client is able to act obnoxious and behave like a fool, But any actions the client/player trys to make is only ok if the server specifically allows that action to be carried out.

golden granite
#

Server generates deck, client unaware of deck. Client needs a new card but has to go through server so it performs an event thats replicated with Run on Server, and perhaps passes a reference to its player controller(since thats easy)

regal relic
#

Sure.. Sounds good.

golden granite
#

server pulls a card from its deck, gets player state from controller(were now working on servers copy of the PC), and sets the new card to a variable in the PS

modern fable
#

Depends on where you want to handle game's logic tho

golden granite
#

since PS is set to replicate and its the servers copy, it will automatically fiire on the clients end as well?

regal relic
#

Yep.

#

Well.. Probably..

#

๐Ÿ˜ƒ

golden granite
#

okay, so sounds like I have a plan then.

#

lol

#

server also checked "reliable"

regal relic
#

Sounds bout right..

golden granite
#

i knew the server kept copies but I didn't know you could have them automatically replicate

modern fable
#

Does Playerstate exist on all clients?

golden granite
#

I could do a rep notify on the playerstate variable(still on servers copy) and client would get the update

#

yes

#

it should

modern fable
#

So all clients get the update

regal relic
#

Yeah and the server will discard and replicate the bad data with ITS authoritative good data the next time it gets the chance.

golden granite
#

but shouldnt only one client get it?

#

like uh.. for example

modern fable
#

That's only if the actor is owner-relevant

regal relic
#

Yeah you only want to send the client hand to the singular client until the show of hands.

modern fable
#

A controller is, a state isn't

golden granite
#

ah but u can set the state to be

regal relic
#

Yeah use controller i suggest.

modern fable
#

You can do instead

golden granite
#

okay

#

i store controllers anyway

regal relic
#

state is good for holding score, and stats.

#

no so much for mechanics.

modern fable
#

Have a non-replicated value, and do what the automatic approach would do

regal relic
#

Namely it does'nt inherit from the same hierarchy as the actor classes do.

#

Thus casting is a pain.

modern fable
#

So set it before calling an owner RPC that updates it on owner's end too

#

So you manually 'replicate' its value relevant to its owner

golden granite
#

wouldnt just setting it with repnotify work?

modern fable
#

Other clients would get it too

golden granite
#

eg on event postlogin you get the player controllers that logon

#

pc1 pc2 pc3 so on

modern fable
#

I'm talking about playerstate though

golden granite
#

client says, I need a new card and provides a reference to its PC

#

server says okay, finds copy of PC on server and sets values that are replicated with repnotify

#

then only that one client should get it, right?

#

or i could do run on owning client instead of using rep notify

#

within the servers PC copy

modern fable
#

Or just have it under player's state with a rpc

regal relic
#

I'd stay away from the repnotify till your a little more experienced with the other methods.

#

I rarely use a repnotify.

modern fable
#

Same, but still it's just generally a best practice to have such game-relevant values going over player/gamestate rather than in a PC

golden granite
#

well you can get PS from PC

#

so i dont see why i cant do that

#

and it has a relevant to owner tickbox

regal relic
#

Sure you dont wanna store anythere there for long term, It is instanced after all, But sometimes thats what you want.

golden granite
#

think i'll read over that PDF sometime. bit late tonight but im sure theres useful stuff in it I can learn from

#

per level, right?

#

but that would be ideal

modern fable
#

Depends on seamless travel

#

Not sure if it resets even in that case though

golden granite
#

well I believe I understand it now, and how to handle sensitive data. I appreciate the help ... maybe someone in the future wil ask the same thing and I can clarify haha. I usually help out with blueprint stuff on answerhub

regal relic
#

If you dont have an Avatar (actor,character) a playercontroller is not a horrible place to put Controls ๐Ÿ˜›

golden granite
#

theres no avatar other than that for visual, but which ultimately does nothing and u have no control over

regal relic
#

After all the server has your playercontroller reference probably easier that anything els.

golden granite
#

just kind of a, hey look at me

regal relic
#

Its right there when you login OnPostLogin

golden granite
#

yea

#

I already manage those

#

extremely useful

regal relic
#

That reference you get on that event in gamemode is a player controller reference. When it comes to organizing and handling your players.. Thats the place to start.

golden granite
#

thats how I know which client is requesting what

regal relic
#

Yep.

golden granite
#

just keeping the deck private was an issue, but think we have that figured out

regal relic
#

Hell you CAN write that code in the controller IF you wanted just make sure it uses the Run on Server RPC

#

So that was its the servers authoritated version of your controller, and not the client. Then anything the server does you can turn around and make an rpc back to the run on owning client. And only Their controller will receive the call.

golden granite
#

i'll probably just use a separate bp for organizational sake

regal relic
#

Sounds good. I think you got it now.. Might take some playing with it

#

BTW if you dont do it i highly suggest watching values, and taking advantage of breakpoints.

golden granite
#

havent used them yet because i havent had any unexpected variable results that werent obvious mistakes. I assume it acts like any other programming language where the game pauses and shows you values once you hit the breakpoint, then you can resume manually.

golden granite
#

PC is supposed to be on all clients/non-dedi servers right? So it should return true to has authority on clients, right?

#

hmm guess PC loses auth once a client joins a server

modern fable
#

sorted it out? @golden granite ๐Ÿ˜›

sly kernel
#

is there a difference between VR multiplayer and regular multiplayer ? (framework I mean, not experience)

modern fable
#

not really, you have to figure out though how and what you want to replicate

#

that'd be replicating motion controllers' location and so on

sly kernel
#

so basically if I have working MP in my conventional game, I could just use same framework and add motion controllers replication to have MP in VR ?

modern fable
#

exactly, plus extra character initialization if you wish

#

(changing where the origin is and such)

#

the only thing that really differs is that you want other players to see where your hands (and head) are

sly kernel
#

I see.. Thanks

modern fable
#

there are different approaches on doing that, btw

#

the best one I know of is having two motion controller components (one for each hand) with their player index set to -1

#

then I just change that index to 0 if the character is possessed locally

#

then I just grab components' transform and send it over to the server so that it replicates

#

just so you know ๐Ÿ˜›

golden granite
#

@modern fable kind of. I was finding that client doesn't have ownership over its player controller. But this apparently only happens after it joins a server.

#

Just thought it was weird since server has its own copy.

modern fable
#

a player is the owner of his player controller but doesn't have authority ever over it

#

guess that's what you mean? @golden granite

golden granite
#

Yeah, sorry

modern fable
#

so authority is the network authority, so it's the server always

fossil silo
#

hey guys, do you know if there is a way to allow two computers on the same network, with the same codebase, to run PIE in editor, and connect via console and IP with one as the listen server? Or do I have to build for networking to work on lan?

golden granite
#

@split galeam#2406 I thought clients had authority over actors they spawned, game instance, and player controller. but its np, I believe they still have authority over game instance so I'll use that.

#

@fossil silo What do you mean with the same code base? You mean launch two clients in the same editor?

#

Also, you can try launching in the editor as stand alone game, might work.

modern fable
#

@golden granite the server is spawning those actors so its their authority

#

then players possess them and are set as their network owner (for replication purposes)

modern fable
#

and well, a game instance exists per game instance ๐Ÿ˜› so it's local

#

@fossil silo not possible, I read that it was a 'planned' feature but yea

golden granite
#

Think my brain just needs a rest. I had all this figured out not long ago and now I'm just screwing things up. I'll sleep on it then try again ๐Ÿ˜ƒ

modern fable
#

๐Ÿ˜ƒ

golden granite
#

Hah, right before giving up I fixed it.

#

I realized my mistake. I forgot I needed to execute a On Server method on an owned object by client

#

But you and the other guy(I forgot who, sorry but ty) helped me understand a lot that I wasn't aware of previously.

golden granite
#

@modern fable Just to confirm: run on owning client is running the servers copy and replicating it to client, right?

modern fable
#

run on owning client is called from the server and running on owner's end

#

other way around, run on the server is called by the owner and executed on the server

#

and a multicast is called server-side and executed on all clients (+ server?)

golden granite
#

Was hoping run on client was servers copy. Would have made life easier.

#

Run on servers copy and push to client.

twin juniper
#

Hello, please, has anyone got this inventory and storage working properly in multiplayer? I am stuck on storage box...

thin stratus
#

What exactly are you stuck on though

pliant cypress
#

Happy days! My card game is working again! ๐Ÿ˜„

wise depot
#

Hey guys, don't suppose any of you know of a way to see where a dedicated server is allocating its memory at all? I've compiled a standalone server and at idle it runs at 1.2gb ram usage and memreport is only accounting for around 300mb of it

#

memreport -full that is.

it shows the correct ammounts allocated but doesn't show what's using up the majority of it

keen gale
#

Interesting question indeed, what UE you are using?

#

There are some improvments coming to dedicated server memory consumption in 4.14 I believe

#

And did anyone try to add additional input functionality to multiplayer that is replicated across clients?

#

Currently I'm thinking to add Nitro to a vehicle, but I'm quite confused how to go about it.

#

I'll have a vehicle pawn which holds amount of nitro it has, and I need to somehow replicate it so that clients would know about it. And then if client wants to use nitro it should send input to server and apply it without waiting locally.

#

Which should turn out good, right? Or am I missing something?

#

And other clients need to know that nitro being used on top of that*

prime horizon
#

Hey everyone, I have a multiplayer c++ project and I can find LAN games with steam (2 seperate accoounts and machines) but I can't find games online (can't find game that my friend is hosting and she can't find mine when I host). Is there something that I should be looking for or does anyone have a clue on what the problem could be?

#

And ofcourse we had LAN disabled

keen gale
#

do you login with server account?

prime horizon
#

Yeah

keen gale
#

I mean, you need server token which is registered via manageservers

#

at valves website

prime horizon
#

Oh sorry misunderstood you

keen gale
#

I might be wrong though

prime horizon
#

Oh really even with the Spacewar appid?

keen gale
#

ah, not sure about that one

#

doubt it will help though

#

it mostly used to prevent valve games from being hacked (changing game skins, etc)

prime horizon
#

Ah, thanks anyway cool to know

keen frigate
#

Hey, I'm currently a little stuck at a problem in my Multiplayer game: When I call EndMatch in my GameMode, I have a 10sec cooldown and at the end I basically want to restart the match without re-loading the whole map again. Is there any way to go back into the WaitingToStart State? Is it somehow possible to basically reload everything from right after "EnteringMap"?

keen frigate
#

I've created some cpp code for this now, where I manually set the state using 'SetMatchState(MatchState::WaitingToStart);'. and then ResetLevel.

dawn linden
#

We're using Steam & UE 4.13 for our multiplayer and we're running into a very consistant issue where the first Join Session attempt finishes loading the level but then gets kicked back to menu with a Connection Timeout failure. After that first failure, all future joins have no issues. Are there any known issues related to this behavior?

keen gale
#

does ResetLevel reset components?

#

it seems like it won't

#

it looks like it resets jack shit

#

@keen frigate did you check if it works?

sturdy tulip
#

Hey everyone. So I'm creating a multiplayer for my Senior project and I'm having an issue where my client characters do not affect anything happening in the game. My character properly spawns objects like ground traps, bullets and other items but unfortunately they don't cause damage nor does but my server character works fine. I feel like it's something simple I'm missing. Can anyone help, thanks.

brittle sinew
#

Are you only spawning the objects client-side? If you want the objects to affect others you'll have to spawn it server-side @sturdy tulip

sturdy tulip
#

I assume I'm spawning it on the client side and they are replicated cause my server character can see it @brittle sinew . I'm unsure on how to make my server character spawn anything on the server side. I've tried setting authority of my "action" button to be the server but when I do that my client can't perform that action all together.

brittle sinew
#

You'll have to set up a client-to-server RPC (if called by the server it just runs too) to spawn the traps on the server... though you want to be careful how much power you give the client in deciding what happens, you'll want to do checks on the server as a general rule in a MP game

sturdy tulip
#

I'll try to figure that out when I get home in a little while and respond back to ya, thanks

keen frigate
#

@keen gale yeah it works as intended. It calls the Reset function on all Controllers and all actors that return true for "ShouldReset"

#

you can also implement the event "OnReset" that every actor has for custom logic

sturdy tulip
#

Ok, thanks

bitter veldt
#

alright

#

this is probably a better place to ask questions regarding multiplayer

keen frigate
#

Basically: gameplay relevant actors should always be spawned on the server side and then replicated to the clients. If your client e.g. wants to spawn a trap, then he should be calling an event that is set as "Run on server" which should then spawn the trap actor and this actor needs to be set as replicated

bitter veldt
#

if I wanted a user to join an advanced session (steam)

#

would I still use the join session node

keen frigate
#

what exactly do you mean with "advanced" session?

bitter veldt
#

have you heard of the plugin Advanced Sessions?

#

i am referring to that

#
#

using this for more functions ;p

keen frigate
#

oh nice, no didn't know about it ๐Ÿ˜›

bitter veldt
#

yea it's pretty neat

#

like the ue4 tutorial things but using adv session now

#

then i have this to join

#

not sure if this node can still be used

#

maybe the plugin still uses these nodes?

#

uses that *

keen frigate
#

hm, as I haven't worked with this plugin I can't help you. But I'd guess that, if he doesn't have a custom Join Session node, the standard one will be fine. Have you tried it?

bitter veldt
#

I don't even have the GUI created yet

#

so I can't really try it ;p

modern fable
#

that plugin only wraps and exposes functionality to BPs

#

unless there's a connect function included, you should be fine using default one

bitter veldt
#

@modern fable i am using it correctly though, right?

modern fable
#

I guess ya

sturdy tulip
#

Thanks @brittle sinew and @keen frigate it was me doing the RPCs the incorrect way. Got it working now

keen frigate
#

You're welcome! Glad to hear it's working now.

sturdy tulip
#

Hey @brittle sinew , @keen frigate or anyone who may know the answer to my new question today lol. I have an issue with networked multiplayer and player controllers. I have a few different instances where I use get player controller and because it index is 0 it affects only what the game sees as player with index 0 or it simultaneously does it for all characters. Example when I shoot with my Gun BP I have a LineTrace for the bullets. I'm using GetPlayerController to get my vectors for start and end but all my player shoot and my client players don't apply damage. Also I have it play force feedback but it only applies it to whom the game sees as player index 0, thanks.

brittle sinew
#

I would advise against using the GetPlayerController that takes an index in, I would do everything on the PC then use C-S RPCs to do your damage things

#

Once again though, be careful how much power you give the client

sturdy tulip
#

@brittle sinew I'm lost. C-S RPC works on everything else I'm doing except when I use GetPlayerController. How would I get the players controller to give it rumble if I make my own PC (instead of using the default one)

brittle sinew
#

Where are you calling the rumble?

sturdy tulip
#

I'm calling it on my GunBP after it applies damage. The target input for it says it had to be a Player Controller Ref

#

I spawn it, it line traces, applies damage to hit actor then play rumble

#

Want me to screen shot it?

brittle sinew
#

Give me a second, I'm going to see exactly how I did it in one of my projects

sturdy tulip
#

Ok, thanks

brittle sinew
#

The way I did it was get the controller of the owner of the gun, which is my character

#

Using the index one isn't great IMO, you're relying on the order of the PCs if you're on the server, I usually just directly use my references to find what I need

sturdy tulip
#

You mind sharing that screenshot?

brittle sinew
#

Note that this doesn't use the greatest anti-cheat precautions, this was for a PvE game and I was only planning to play it with friends ๐Ÿ˜„

#

Not sure you'll be able to exactly get what's going on if you're BP only

#

The most important lines are ACarditCharacter* Owner = Cast<ACarditCharacter>(GetOwner()); and Cast<ACarditPlayerController>(Owner->GetController())->(function)

sturdy tulip
#

It's my Senior Studio project so for the purpose of getting a grade, I can fix cheating possiblities later, I just need stuff to be playable lol

brittle sinew
#

๐Ÿ˜„

sturdy tulip
#

lol

brittle sinew
#

To be honest there's probably 100 things I could improve here, this was from a while ago

#

But that's the gist of it

sturdy tulip
#

Lol yea, now I'm just over here trying to translate this to BP in my brain

bitter veldt
#

hey there

#

i need some assistance

#

I have 2 different modes in my game and one mode is 4 players and the other mode is 5 players

#

in the creating a server menu, i already mave a widget where it's like Gamemode Type and left and right buttons with text in the middle

#

would i have to make it so if they have gamemode a selected, it'll use numberofplayersfora variable which is 4 players

#

i guess i would the text to some sort of function too?

thin stratus
#

What is your exact question here (:

#

How you can tell the GameMode of the next Map the Number of Players the User has chosen in the Host Menu?

#

@bitter veldt

bitter veldt
#

@thin stratus I may have figured it out in my head because I was dealing with another issue but anyways I have 2 gamemodes in my game

#

like

#

not UE4 gamemodes

#

just 2 ways you can play the game

#

I'll just make a variable and assign it to text

#

I'll try my idea out in my head

#

think it'll work

thin stratus
#

Each way to play the game should have a different GameMode though

#

I mean, that's the idea of a GameMode

#

Other information should be passed via the Options String

#

Same as the GameMode to use

brittle sinew
#

Don't forget you can use inheritance for GameModes too... I realized that flew straight past my head a while ago after the fact ๐Ÿ˜„

#

Because most likely a lot of the core functionality is the same

summer nova
#

example. Capture the Flag from Team Deathmatch

#

you remove scoring by kills, addd scoring by flag

#

and TDM from normal DM, but with same team damage disabled

thin stratus
#

Well yeah, you can inherit from nearly everything

bitter veldt
#

so if I have one map but I wanted 2 gamemodes

#

I'd make 2 gamemodes?

#

and if the host selects one of the gamemkdes

#

gamemodes

#

it'll load it?

#

ah I wait I can't do that

#

I'd have to have 2 mals

#

2 maps

#

different gamemodes

#

alright cool

modern fable
#

can't you switch between modes

#

๐Ÿ’ฉ

bitter veldt
#

@modern fable is that possible lol?

modern fable
#

nope

#

you can have a map with a gamemode override set though

bitter veldt
#

yea

#

that's what I was sayin earlier

modern fable
#

not sure if having seamless travel on and doing that disconnects the clients?

bitter veldt
#

2 mals

#

maps

#

different gamenides

#

gamemodes **

modern fable
#

๐Ÿ‘€

bitter veldt
#

what

modern fable
#

does it disconnect the clients

bitter veldt
#

I have no idea still not on computer yet

#

in bed

#

no reason for it to disconnect clients?

#

server will host game

#

client will find a match and join

modern fable
#

yea but given you can't change the gamemode manually, not sure if that works with seamless travel on

bitter veldt
#

well we aren't changing it while they are in a fame

#

game*

#

I think it will work I have no idea

modern fable
#

the gamemode is more than that

#

that's the 'issue'

bitter veldt
#

I've googled and looked around

#

oh?

#

I mean the 2nd gamemode will basically be a copy of the first gamemode

#

not sure tbh

#

just a question I've asked before but not in this channel

#

how would someone go upon joining a game with steam with a dev build

modern fable
#

testing it is the only way to find out

bitter veldt
#

with steam on a dev build*

#

I already have the ability to make steam sessions/servers

#

but how would someone else join

#

currently only LAN works

#

haven't gone around to testing steam

modern fable
#

don't steam sessions show up with find sessions

bitter veldt
#

I have no idea. what port would it be looking for

modern fable
#

steamworks handles that

bitter veldt
#

yea but isn't that more of a dedicated server thing?

#

and since I am using appid 480

modern fable
#

well you can also host games thru steam

bitter veldt
#

steamworks still applies to tha tright?

#

that right *

modern fable
#

not sure then, you might need your own app

bitter veldt
#

hmm I saw an unreal guy testing it with 2 different connections

#

one on his laptop connected to another network and different steam account

#

then he has his desktop who is hosting the match on a different network

#

and steam account ^

modern fable
#

direct connection maybe

bitter veldt
#

you mean connecting via IP and port?

modern fable
#

yea, or joining their game thru steam's overlay

#

not sure though, haven't used Steam that much

#

but I'd go that way when testing

bitter veldt
#

na he wasn't direct connecting

#

it was the blueprint tutorial

#

he just did "find a match"

#

and boom his match appeared

#

I'll see

#

I should probably implement something that finds friend sessions

#

or the ability to invite people to your own session

bitter veldt
#

na I don't want to look at anymore tutorials at this point

#

I need to have some fun in unreal ;p

modern fable
#

1:23:24

#

he's using find sessions

#

nevermind that, that tutorial ain't specific and ends up being a mess

bitter veldt
#

lol

modern fable
#

anyhow, find sessions was the interesting part xD

bitter veldt
#

finally on computer

#

with pancakes

#

lel

golden granite
#

You can add multiple player controller indexes for AI on the same client right?

brittle sinew
#

What do you mean by that?

golden granite
#

Well the game is online multiplayer, and I need to figure out how to implement AI into that as a player.

#

If I could connect AI as a client to the server it would be easy, but I'm not sure that's possible?

brittle sinew
#

Well AI don't use PlayerControllers, so if that's what you're asking about no

golden granite
#

Yeah, so there's problem numero uno.

#

Haven't started on it yet, just trying to think of the best way to implement the AI as it's own client, if possible.

brittle sinew
#

You might want to bump some of your PC functionality up to an AController

#

So your AI can make use of it too

#

Though I've never done anything like this, so not sure

golden granite
#

Yeah, tricky situation.

modern fable
#

do you mean having AI as a player replacement?

bitter veldt
#

hi

#

I am having a weird issue

#

so I assigned a mesh/model to my fps so i could see it on another client

#

but when i am connected, i don't see the other character

golden granite
#

@modern fable Yes

bitter veldt
#

ah fixed

golden granite
#

@bitter veldt Make sure the actor is set to replicated

bitter veldt
#

for some reason the mesh was set to onlyo wner see

#

only owner*

golden granite
#

Ah yeah, that will do it as well.

#

@modern fable I'm just brainstorming ideas on how to duplicate data a normal player would have on the server, which is also already a player.

#

Because currently variables are separated per client, so it works. But if the server is to share AI -- bit of a predicament.

bitter veldt
#

alright so I had my friend download my game

#

i created a steam session

#

he can't seem to find it

#

so i guess i have to have my own app id or something

modern fable
#

is lan turned off / if steam overlay working - does steam launch with the game too

bitter veldt
#

LAN is turned off and steam overlay works

#

it's on steam mode

#

I packaged the game as development because when it's set to shipping

#

steam doesn't work

thorn merlin
#

@bitter veldt i know little about steam, but perhaps its steam region? does your friend live geographically near you?

#

@bitter veldt for the epic mega jam, when we played games, allar had us change our steam region so we could all play together

bitter veldt
#

@tame thunder I live in Canada and my friend lives in united states tn

#

@thorn merlin **

bitter veldt
#

alright

#

so i had my friend who lives couple blocks away test out the game

#

he couldn't find the session either

#

steam integration works (launches game as Spacewar)

stiff wasp
#

@bitter veldt both you and your friend have to be in the LA download region.

#

on steam

bitter veldt
#

@stiff wasp what really?

#

I have to set the download region to LA?

#

i have the packaging thing to set to shipping

#

and then i have a steam_appid.txt with the id 480 inside of it

#

i add the game onto steam

#

am i doing that correctly?

#

can anyone confirm this?

#

regarding the LA download region

#

alright

#

so I tried that out

#

that isn't working either

stiff wasp
#

If both you and your friend are on the download region LA, then you did something wrong in your code

bitter veldt
#

not sure as to what could be wrong @stiff wasp

stiff wasp
#

show me the code

bitter veldt
#

blueprint?

stiff wasp
#

if that is what you programmed it in then, yes. Show me the BP

bitter veldt
#

alright un momento

ocean dust
#

Hey everyone

#

I am replicating an array of actors like so:

#

The display on-screen shows:

#

Server: <Actor display name>

#

Client 1:

#

And indeed, the remote client gets the array size change, trys to iterate over all of the items, but finds None where there should be a replicated Actor

#

What gives?

ocean dust
#

Nevermind, found it: the Actor was marked with Only Relevant to Ownerwith an owner that was not the Client in question.

fresh saddle
#

Should "Set Simulate Physics" be called on Server->Multicast or local only?

fossil silo
#

hello friends!

#

wanted to ask, is there anything special I have to do to get the Create & Find Sessions working on LAN besides setting the subsystem? I create a session, but cant seem to "find" any on the same network

#

thanks in advance!

twin juniper
#

@fossil silo Which subsystem are you using? Are you playing in standalone or PIE?

twin juniper
#

After using the steam onlinesubsystem-plugin instead of enabling it manually in build.cs I'm seeing this when trying to find sessions:

LogOnline:Warning: STEAM: Removed incompatible build: ServerBuildUniqueId = 0x7ca67746, GetBuildUniqueId() = 0x7c7123d0
LogOnline:Warning: STEAM: Unable to parse search result for lobby 'Lobby [0x1860000A6415FC9]'

Find sessions returns successful, but without results. I'm able to create and travel, as well as friends list.

night jay
#

Try what's in here

#

For my question though

#

I know you can preserve playerstates inside a session so when someone leaves and joins again later he will be rebound to his old playerstate

#

But how can I make sure the variables in that playerstate are retained?

#

Stuff like how many times that player died etc.?

#

When someone quits and rejoins it's reset to 0

odd nimbus
#

How to begin creating Master Server for a FPS Game?

thin stratus
#

@odd nimbus Get a Server (costs money), setup a Database, setup a layer in between UE4 and the Database via php or so, setup logic to let the Server Register at the Database through Session and
Keys (authentication), setup logic to retrieve a list of the registered servers, ..., profit

brittle sinew
#

...which is why it's usually just recommended to go with Steam

#

๐Ÿ˜›

#

I wouldn't even want to think about setting that all up

lapis quarry
#

Looks like this should've been solved in 4.12, but I'm still having this issue.

#

And I'm also a bit confused with Sean Flint's answer futher down "Many instances of this issue can be linked back to the fact that meshes or other components that are attached to the capsule are not being smoothed because the capsule does not have smoothed position"

#

Since the capsule component is the root and inherited, isn't everything basicly attached to the capsule?

normal ingot
#

So testing a MP game with ?listen

#

is there a console commande to show connected players?

lapis quarry
#

Don't know if there's a console command for that. But you can get the "PlayerArray" from the GameState.

normal ingot
#

cheers

#

i'll give it a go

brittle sinew
#

And if you really want to do it by console, you can always set up an event to loop through and print each one, and call that from console

grand kestrel
#

does anyone have experience with writing custom prediction for their games, just wondering about whether it's a better option than dealing with Epic's.. honestly doesn't feel like i have any way to add multiplayer to my game atm because i can't fix anything with epic's implementation

wise depot
#

What's the problem @grand kestrel

grand kestrel
#

@wise depot was trying to do stuff that epic's prediction couldn't handle, in the end i think i'm going to write my own, but i found some resources to go through so i'll ask again once i run into another roadblock ๐Ÿ˜›

lapis quarry
#

Is this a blueprint or C++ projects @grand kestrel ?

grand kestrel
#

C++

#

for the record i re-wrote thousands of lines in CMC before running into the roadblock to do arbitrary orientation, this wasn't some basic misunderstanding ๐Ÿ˜ฆ

#

but that said, i know almost nothing about prediction atm, so i can't work with their system at all, i feel that i need to start from the basics before giong anywhere near it

#

so this will kill two birds as they say

lapis quarry
#

Alright. Good luck!

grand kestrel
#

ty ๐Ÿ˜„

#

the frustration really got to me this time haha

#

in the past i've had projects die from similar roadblocks, but i'm more experienced now

lapis quarry
#

Just don't give up and you'll get the hang of it ๐Ÿ˜ƒ

odd nimbus
#

@cedric_exi Actually I don't want to use PHP as a communication system for my UE4 game and Database. First clarify me some stuffs. For a game which have almost 1k players what kind of database I should use? I am planning to store a lot of data on the database like game history, scores, user settings and some other bunch of stuffs. Should I go with normal MySQL Community Database Server? Now the next question is communication from game to the database through PHP or a dedicated master server C++ application which will be running on a linux box. Which you think more faster, convenient and secure? And I already have a linux server in Singapore to test these things out.

odd nimbus
#

@cedric_exi And the full blueprint networking project link that you gave me I watched but I prefer to code the networking of my game and other core factors using C++ instead of blueprint. I just wanna use blueprint for Menu and HUD the UMG stuffs. Is there any good youtube Tutorial Series link for doing a Multiplayer Game setup with C++ including lobby and everything else like this Tutorial Series

brittle sinew
#

It really shouldn't be too difficult to copy the functions within the blueprint

#

You can right click BP nodes to find the C++ equivalent of it

odd nimbus
#

Every blueprint can be converted to appropriate C++ codes?

brittle sinew
#

For the most part, yes

#

I'm not entirely sure how things like delays work behind the scenes, but I think you'll find everything in that tutorial pretty easy to transfer

odd nimbus
#

ow nice

#

Thanks for the info bro ๐Ÿ˜ƒ

proud wren
#

Hey, could anyone give me a hand with my sessions? I have it setup so when you hit host, it creates a session. And when you hit join, it finds sessions. But when you find a session and join it, it puts you in a different session than the one with the other player, and you can't see each other. Any idea what may be wrong

modern fable
#

are you joining the session

proud wren
#

if you mean do I have the Join Session node, then yes ๐Ÿ˜›

stiff wasp
#

I am guessing you have a Open Level node after you create the session like I showed you? Did you remember to add the ?listen to the Open Level node?

proud wren
#

I totally forgot to add that, but it still fails to join the session. :/

#

so i got it to load a session now, and they are still not in the same session even with the !listen in the option

modern fable
#

where do you decide whether you are joining or creating a session

proud wren
#

I have a button in the widget, when the player clicks it it goes through the Find Sessions and then Join Sessions nodes

modern fable
#

so you are not creating a session if finding fails

proud wren
#

nope

#

not yet

modern fable
#

rite, so the client is joining successfully on its end?

proud wren
#

its joining something, but you can't see the host. I create a session with one, and try to join with the other

modern fable
#

is the client connected

proud wren
#

how do I check?

modern fable
#

add a message on gamemode's post login or smth like that

#

print*

#

so that a message is output when a client is given a controller

proud wren
#

alright, they are joining the same session

modern fable
#

so now, are you using pawns

#

or rather, are those being replicated