#multiplayer

1 messages · Page 320 of 1

ocean mango
#

Unreal won't know how to handle data in a buffer sent from an outside source without casting it. So you might want to come up with some magics for your packages

worn nymph
#

can anyone help with this replication issue had a long day and my brain isnt working

jolly siren
#

what is the issue?

worn nymph
#

basically the projectile is being spawned by the player and by the other clients

#

because of the multicasdt

#

but if i change it from multicast then i only get one projectile

#

but clients dont see the animation

jolly siren
#

get rid of the server rpc in the anim notify

#

and just make it spawn the actor directly if it has authority

worn nymph
#

but thats there so it only spawns when the anim is finished

jolly siren
#

still use the anim notify

#

I didn't say to stop using the notify

#

I just said get rid of the server rpc

#

AnimNotify_spawnarray -> has authority -> spawnactor

#

the way you have it now all the clients and the server is asking the server to spawn the projectile

worn nymph
#

you cant do authority check in anim bp

#

it only exist on client

jolly siren
#

yeah that's not true

#

if the animation is playing on the server the anim notify will be hit on the server

worn nymph
#

oh its cos it was context making it not show up

#

why does that work but if i have the authority here

#

it doesnt isnt that doing the same thing

jolly siren
#

no

#

if you do authority check in the server rpc it will always be true

#

since the server rpc is executing on the server at that point

#

doing an extra rpc is wasteful anyways

worn nymph
#

what just do the spawning straight inside the anim bp

jolly siren
#

yes

worn nymph
#

ok cool thanks

jolly siren
#

np

worn nymph
#

hmm

#

still not right

#

now when i fire it works fine on client 1 but when i fire on client 2 it makes client 1 fire

brittle sinew
#

You're using get player character at index 0

#

So, it will always make the character at local index 0 fire

worn nymph
#

so how should i set it up then

brittle sinew
#

It's a very good idea to never touch those types of functions in MP 😛

#

I'm not entirely sure what an anim BP gives you, can you get the pawn off it?

worn nymph
#

try get pawn owner?

brittle sinew
#

Yeah, it seems like that would work

worn nymph
#

yeah

#

thanks

#

going to take a nap too tired to do aanything usefull keep making stupid mistakes . thanks for the help both of you

jolly siren
#

yeah try get pawn owner is what I use

#

sorry meant to mention that earlier

vocal ingot
#

Does PlayerState variables/data persists between levels?

jolly siren
#

travelling?

#

yes

primal ember
#

Hey MP programmers, I am replicating a mesh's world Z location via a replicated float. When running on dedicated server, the client appears to move the mesh in a really choppy manner when it executes the set world location. Updating the net frequency helps slightly, but feels wrong and still doesn't entirely resolve the issue. Has anyone run into this sort of thing?

#

Movement replicates just fine. Does movement replication have a greater net update frequency or something?

severe widget
#

prediction

vocal ingot
#

Client side prediction

#

before setting your location, get the current location and interpolate it to the replicated variable

primal ember
#

I tried doing an finterp to the replicated variable and it didn't seem to help.

severe widget
#

Its not as easy if you're only replicating a location

primal ember
#

They either interped too slowly or when I increased the speed they still got popping.

severe widget
#

Unless its a constant speed or something

primal ember
#

yeah also tried finterp constant

severe widget
#

In which case, just rep that movement started and run it on both sides IMO

primal ember
#

well but if the mesh location is important for collision

#

then couldn't that cause issues?

severe widget
#

I don't mean the interp func

primal ember
#

Yeah you meant the function that calculates the desired location, right?

severe widget
#

I guess

#

The distance / time

#

effectively

primal ember
#

I'm going to research client side prediction for a minute to make sure I'm not missing something obvious.

primal ember
#

Someone suggests running it both on the client and the server, which would allow the server to correct to the server-authoritative position. That works for movement, but would that work for other things as well?

jolly siren
#

Hmm is PC not the default owner of Character?

#

strange

#

How does COND_OwnerOnly work with Characters then?

vocal ingot
#

COND_OwnerOnly means server will only replicate/send that variable to you

primal ember
#

Does the animation systems also implement some version of prediction?

#

What I'm wondering is if I implemented this same thing in animations (a mesh movement up and down) instead would networking be easier?

jolly siren
#

I don't see where in the possession code the Pawn/Characters owner is set to the PlayerController

jolly siren
#

@thin stratus any idea on that since you wrote it? ^

#

It's looking at the Owner to decide things like COND_OwnerOnly

#

But I don't see where the Owner is set for a Pawn on possession

jolly siren
#

@rough iron ^

rough iron
#

You can set it explicitly

#

Have a look at my MP twin stick sample

#

There is a SetBase method

jolly siren
#

So it's not set on possession automatically like cedric's compendium suggests?

#

checking out your sample now

#

I don't understand how COND_OwnerOnly works if the owner is not set then..

#

because looking at the source it shouldn't work

#

@rough iron I'm not seeing SetBase in your TwinBlast repo

#

I know about SetOwner if that's what you meant. But I'm asking if it is supposed to do that ootb like @thin stratus compendium suggests. And if not, then how does COND_OwnerOnly work without the Owner. Because looking at the code I linked above it shouldn't.

#

I do see ACharacter::SetBase in the core code, but it doesn't look to have anything to do with this.

rough iron
#

It should get called down the line in the posession process

jolly siren
#

I've searched the code base

#

for a long time

#

I can't find anywhere that the owner is set

#

After possession, my character's owner is NULL for Authority and AutonomousProxy

#

but COND_OwnerOnly replication in Character is working

#

it makes no sense to me

#

I added the following to shootergame's playerpawn too, to see if theirs would give different results. And it doesn't..the owner is still null after possession

#

But COND_OwnerOnly still works.

#

How?

#

🌍 I'm starting to think the earth is flat today

#

Hmmm well well I'm not insane after all. Unreal Tournament ran into this issue too.

#

But that still doesn't explain why COND_OwnerOnly would work if the actor doesn't have an owner

#

Because it's still working for sure

#
DOREPLIFETIME_CONDITION(AFPSCharacter, Killstreak, COND_OwnerOnly);```
#

Ahh missed the fact that Pawn overrides GetNetConnection

#
class UNetConnection* APawn::GetNetConnection() const
{
    // if have a controller, it has the net connection
    if ( Controller )
    {
        return Controller->GetNetConnection();
    }
    return Super::GetNetConnection();
}```
#

so it's using the character's controlller for the COND_OwnerOnly stuff

fringe dove
#

If a character is running towards an edge and jumps and there is packet loss on the jump, does the server end up making the character fall off the edge rather than jump? I see a jump command will get marked important and sent reliably, but it still may not come to the server until the server has already made the character start falling right?

jolly siren
#

@thin stratus you might want to update the compedium with my findings above. The PC isn't actually made the Pawn/Characters Owner on possession. It's just treated as such for various things (most importantly replication) because of APawn::GetNetConnection

#

I'll probably open a PR so it actually set the owner, because it nulls it on unpossess, so it's kind of dumb they don't have it being set on possession

valid lake
#

hey all, just wanted to check in and see if anyone had any experiencing networking physics, and if there is anything I should know in particular before I start trying to impliment it in my game. All I'm drawing off right now is Rama's video about it, but there may have been more recent developments, cheers!

https://www.youtube.com/watch?v=U6dg6xFP178

www.ue4code.com I've successfully done the backend C++ network coding to establish the foundation for my Dream Game ~ A Physics-based Multiplayer Platformer!

▶ Play video
wary wyvern
#

Hey guys! Who can tell me, how to force replication of characters? I nave many of NPC on a map that are controlled by AIController and own schedule. Lets just say they walk and do stuff. But as soon as go far from them and then return, some of them play animation in wrong place. After they done, thay just teleport to server place. So client do not recieve npc server's transform.

jolly siren
#

@wary wyvern how far?

#

There is NetCullDistanceSquared

#

on the actor

#

By default Unreal replicates an Actor when it is within range of a client (AActor::NetCullDistanceSquared controls the culling distance).

wary wyvern
#

Just tested a bit more. It looks like my mesh is not replicationg properly. Capsule seems to be in right position.

sly kernel
#

so, how is it that Doom 3 single player code for example, could have been adopted for MP and in UE4 single player BP code has to be completely redone from scratch to add MP support ?

vocal ingot
#

How to set custom server name (custom session name) in C++?

worn nymph
#

what collision settings do you have to put for a projectile to damage player in multiplayer everythingh i try the bullet just goes straight through and doesnt make ny events . its wierd because i did it the same setup as in another project and that works fine

#

whats really strange as well is if i set the speed to 0 and walk into the projectile it generates the hits

#

yet if i just stand and wait for it to hit me it goes straight through

worn nymph
#

ok so turns out its because the collision had to be the root component

#

wierd

fringe dove
#

@sly kernel doom 3 was designed from the start for that

#

but even then it didn't ship with co-op, not sure how involved the co-op mod was

sly kernel
#

The fact is that coop mod didn't rewrite code. Original code was modified and multiplayer stuff was added

ocean mango
#

In local multiplayer does anyone know how to set a player's viewport?

#

Set view target with blend does not work

fringe dove
#

how does vehicle physics replication work? I don't see anything similar to character movement replication, with replays/state rewind, etc.

fringe dove
#

looks like it is just actor movement replication and has tons of rubberbanding with any latency

jolly siren
#

Can property replication fail? Or will it always eventually come in a realistic network situation?

sly kernel
#

@fringe dove there is a good vehicle plugin by Blueman. It's MP ready and has vehicular AI

vocal ingot
thin stratus
#

?

#

What exactly do you mean?

#

The project download at the bottom`?

twin juniper
#

googlecode dam thats old, sounds like the guide might be outdated? or can this still apply well ?

vocal ingot
#

@thin stratus yes

#

the download link

#

Also I found an mistake

#

SessionName parameter shouldn't be there in FindSessions

#

you never make use of it

#

inside the function

fringe dove
thin stratus
#

@vocal ingot I can't find the file anymore. Think it went down with the other files I had on a server that went off 2 weeks too early

#

And thanks for the report on that mistake

plush lagoon
#

Thats pretty nice.

#

Client Side Awesome Sauce

chrome bay
#

I uploaded source code for client replay to github

#

The problem currently is replay needs to happen in a different PhysX scene. So far neither me or blue man conquered that problem...

#

Requires either a lot of duplication / data storage or a lot of tolerable errors

sharp mirage
#

Hey guys I am trying to understand Character Movement Component networking, I am unable to figure out how rotation is replicated for the movement component on the clients

#

does it happen automatically similar to Actor replication?

twin juniper
#

How does a "Client" or "Run on owning client" function/event work?

#

If I cast a raytrace, get that actor, cast it, and call a "Client" function, who is it running that code on?

#

The client who casted the raytrace? Or the actor I hit with my trace?

brittle sinew
#

Whichever actor you actually call the RPC onto

#

If you call the RPC onto the traced actor, it will run on that actor

twin juniper
#

ok

#

so i could make a client rpc on my character, trace from one character, (to the other player), and then i could use that to make another client create a "Join My party" widget i created?

#

i cant really test this, but i think it will work?

#

idk

twin juniper
#

@brittle sinew

regal hazel
#

That's brilliant, thanks @chrome bay. What's the overhead like with the extra PhysX scene?

twin juniper
#

So, if a PlayerController Possesses a pawn, is that pawn "owned" by the client or by the server?

#

because if its not then i need to make my code in player controller because i know 100% that the player owns the player controller

#

but im not sure about if they own the pawn they possess

full bane
#

they do

brittle sinew
#

@twin juniper there's not really such thing as being "owned" by a client or server per se, the owner is an object, even though the chart says owned by client

#

When the local PlayerController owns the object, the client has the ability to take owner-only actions on it

#

The server always has authority, but the "server" doesn't own the object, an object is the owner of the object.

#

There's really no such thing as the "server" in terms of objects, there are server versions of objects and the local authority is always highest on the server, but the "server" isn't just some magic black box with all powers

#

I know it's a little bit of a different mindset than say a web application where there is a literal server, but it's just a tad different with UE4

twin juniper
#

hm

vocal ingot
#

@thin stratus how to set custom server name? And how to work with sessions in blueprints aswell as c++? Can't seem to make those tshared pointers or SessionSearch blueprintreadwrite

thin stratus
#

Custom Server Name is something you can only do in C++.
When creating a Session, you can specifiy additional options

#

These can later be retrieved when searching sessions

#

If you use steam, it might be that there are some special rules about the formatting of these "options"

#

you would want to read through the steamsubsystem files and see if they define any

#

probable something like #define SERVER_NAME = "SteamServerName"

#

But that'S just a guess

lost inlet
#

just steam oss things

dawn ember
#

I want to print what the reason for failure is

#

how can i do that?

#

My android version cant seem to connect to the session that I've hosted on my computer and I'm trying to debug it

slim holly
#

sht are they cross -platform compatible out of the box even?

thin stratus
#

I don't think so

#

In LAN maybe

#

@dawn ember GameInstance has two events

#

OnNetworkFailure or so

#

And OnTravelFailure

#

Or OnNetworkError

#

no idea right now

dawn ember
#

@thin stratus Thanks!

#

I ended up reading the network node guide and it gave me a PackageMissing error, then I realised that you need to add maps in the packing option under project settings 😛

twin juniper
#

so for some reason

#

i tried to move my server from my laptop to my desktop

#

change the same port forwarding and windows firewall rules

#

and its just rejecting all connections

#

evfen when i turn the firewall completely off

#

god damn i hate windows

worthy wasp
#

you changed port forwarding on you rrouter correct?

#

@twin juniper

twin juniper
#

yea

#

@worthy wasp

#

do i gotta like

#

reboot the router

#

lmao

#

did a nmap scan

#

port shows up as filtered lol

worthy wasp
#

you shouldnt have to - make sure you dont have multiple instances of the SERVER running on your machine - that will incrememnt the port# i had that happen once and i specfifically only did 7777... so i did 7777-7780

#

eh - thats in command prompt - thats nto on your router

#

unless you have some fancy dangle router.... ❤

twin juniper
#

its not lol

worthy wasp
#

most have to go to 192.168.1.1 (or whatever your default gateway is) and configure from web interface

twin juniper
#

yea

#

no i mean

#

thats the port

#

of my other computer

#

im on my desktop

worthy wasp
#

i can only ask if you changed the port forwarding from your IP of your "other computer" to the ip of your "desktop" for port 7777 - then port fowarding would be setup right

twin juniper
#

yea

#

should be fine right?

#

lol

#

like it makes no sense to me

worthy wasp
#

1.5 is your desktop right?

twin juniper
#

yea

worthy wasp
#

you said you turned windows firewall COMPLETELY off?

twin juniper
#

i have the firewall on my router, and windows firewall

#

completely off

worthy wasp
#

ok

twin juniper
#

right now

worthy wasp
#

AVirus?

twin juniper
#

yet its still blocking connections

#

i dont have anti virus

#

dont need it

#

lol

worthy wasp
#

k

#

do you have the SERVER RUNNING atm?

#

if not - run it with -log in the shortcut.....

#

then

#

in COMMAND PROMPT

#

do a 'netstat -a -n' command

twin juniper
worthy wasp
#

look to see if 7777 shows up

twin juniper
#

uh

#

7778 shows up

#

rofl

#

see

worthy wasp
#

then for some reason its going over 7778

twin juniper
#

yea

worthy wasp
#

and thast why you're being blocked

twin juniper
#

but look at the above screenshot tho

#

it says

worthy wasp
#

again - make a range for PORT FORWARDING

twin juniper
#

"bound to port 7777"

worthy wasp
#

do you have multiple instanaces of Server.exe running?

#

as i said before - it will increment

#

for each instance

twin juniper
#

uh

#

no

#

like

#

i closed out of it

#

7778 goes away

#

reopen it, 7778 comes back

#

so its definitely that lol

#

but i feel like it shouldnt matter

#

i have all ports open

worthy wasp
#

your not forwarding for 7778 in your screenshot from router.

twin juniper
#

yea

worthy wasp
#

so thats why your not getting connections

twin juniper
#

but

#

i have this set lol

#

the global policy

#

is allow all right now

worthy wasp
#

that has 0 to do with port fowarding

#

that is same thing as Windows Firewall

#

just router based

#

open range from 7777 to 7780

#

trust me

twin juniper
#

is there a way of finding out

#

what is using that port

worthy wasp
#

netstat will list all (event time_wait & close_wait) connections

#

unfortunately - if something isnt USING or has used a port - it wont list it

#

otherwise you would have virtually 999,999 ports listed

#

why its nto going over 7777 i have no idea - lemme google search it real quick

#

in your Engine.ini file - whats your SUBSYSTEM definitions look like?

twin juniper
#

wait

#

i just realized tho

#

7778 was UDP

#

lol

#
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
SteamAppId=480
GameServerQueryPort=27015
bRelaunchInSteam=false
GameVersion=1.0.0.0
bVACEnabled=1
bAllowP2PPacketRelay=true
P2PConnectionTimeout=90
; This is to prevent subsystem from reading other achievements that may be defined in parent .ini
Achievement_0_Id=""```
#

is the server tcp or udp

#

lol

worthy wasp
#

from my own experience - TCP

#

i had ONLY allowed UDP on our MS Azure VM ....

#

and i couldnt connect to it

#

opening TCP allowed connections

twin juniper
worthy wasp
#

u have this too?

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

twin juniper
#
[/Script/Engine.Engine]
!NetDriverDefinitions=ClearArray
; Uncomment the next line if you are using the Null Subsystem
;-NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
; Uncomment the next line if you are using the Steam Subsystem
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
#

yea

#

i mean it was working fine on my laptop

worthy wasp
#

all i can tell you is my own personal experience with it.... i had to open/allow TCP in our firewall to allow 7777 traffic from the UE4 dedicated server

twin juniper
#

x_x

worthy wasp
#

i dunno dude but your already 1/2 hour into troubleshooting something you could just open up port range of 7777-7780 on your router & be done with it

twin juniper
#

7778

#

7777

#

wtf lol

worthy wasp
#

i dont know what commands your using to get that output

twin juniper
#

it should say

#

open

#

like

#

when i do one of my other ports (that i know works)

#

it says "open"

#

lol

#

lul

#

i turned on 3 servers just to see that

worthy wasp
#

this last output clearly says svchost.exe is using 7777 - the "three servers" you opened up are labled as VeritexServer.exe (i assume this is your project name.exe)

You are using 7777 for something else ar eyou not?

#

svchost.exe (Service Host, or SvcHost) is a system process that hosts multiple Windows services in the Windows NT family of operating systems. Svchost is essential in the implementation of so-called shared service processes, where a number of serv...

#

why this is running on 7777 i have no idea

twin juniper
#

who

#

fucking knows lol

worthy wasp
#

have you tried Format C:?

twin juniper
#

LOL

#

why would i do that

worthy wasp
#

only kidding bud 😃

twin juniper
#

god damn

#

imagine if i wwere some gullible person tho

#

they would have actually did that

#

lolol

worthy wasp
#

good thing theres a really smart warning saying "hey duh - your about to wipe all data"

twin juniper
#

so i have

#

one "VeritexSevrer.exe" open

#

lol

#

maybe it just means its using those ports

#

lol

#

ok so this is interesting

#

i got all the other ports opened now and working

#

except 7777

twin juniper
#

yeah, basically my server is running on ports 17500, and 27036 for some reason... even tho the dedi server console says "7777"

worthy wasp
#

Question guys - i have 1 character class. I have a test dummy (dragged out character class) in the field that i'm testing damage output & Healing done to it.

Damage works fine due to the TakeDamage() function in UE4's source.

My healing does not. I am successfully stepping through this funciton on the REMOTE PLAYER (test dummy in this case) and it's printing its CurrentHP to log (whatever its value is after I decrement it) But for the life of me i cannot get it to INCREMEMENT by the passed amount..... see anything i'm not seeing?

{
    Server_Heal(HealAmount);
}
void ACharacterBase::Server_Heal_Implementation(float HealAmount)
{
    CurrentHP += HealAmount;
    GLog->Log("CURRENT HP IS: " + FString::SanitizeFloat(CurrentHP));
}
brittle sinew
#

Why not just damage with a negative number? 😛

#

But to address the issue, are you calling the server RPC from a client that owns the character? Can't exactly follow your wording

worthy wasp
#

ok - in my Weaponfire functionality - where i do the damage....

I have different MODES of the weapon

#

if its in HEAL MODE - i heal the target (cast to PlayerClass)

#

i then run:

HitActor->Heal(forthisamount);

#

thats a local funciton - which passes the float value to server RPC

#

which is incrementing the CurrentHP float.... but never does

#

do i need to pipe that back down to Client_Heal_Implementation () ?

brittle sinew
#

Yes, but I'm guessing you don't own the HitActor?

worthy wasp
#

no

#

it would be ANOTHER CHARACTER

brittle sinew
#

You can't directly call a server RPC onto it then

worthy wasp
#

in BP's this is how i successfully would accomplish it

brittle sinew
#

It works exactly the same way in BP, you can't call a server RPC on an unowned object

worthy wasp
#

you are correct - im using a Interface to call the actual server RPC

#

i just looked this up in my BP Prototype

#

so then - should i make an interface class for this functionality - or do i use something else in C++?

brittle sinew
#

I would just call the server RPC on the weapon, passing the pointer to the other actor

#

If you own the weapon

worthy wasp
#

problem is - there really is no weapon

#

not in this game

#

think of it almost like spell casting

brittle sinew
#

Where is your logic for it then?

worthy wasp
#

in a raycast when "I'm Firing"

brittle sinew
#

Yes, but where?

#

The pawn?

worthy wasp
#

yes sorry

#

rather ACharacter type

brittle sinew
#

Cool, you own that automatically

#

You should be able to call the server RPC on self, and just pass along the pointer

worthy wasp
#

while is ee what your saying about the Target = SELF....

#

how do i pull this off in C++?

brittle sinew
#

Put the actual RPC on your character

#

Call it on self

worthy wasp
#

it is...

twin juniper
#

Is there a way to test out whether or not your steam server is not just local

worthy wasp
#

just like the code you saw it above

twin juniper
#

lol

worthy wasp
#

@twin juniper - i know for a fact you have to be greenlit to use dedicated servers or any server build for projects

brittle sinew
#

Yes, but I mean you call it on self passing the other actor, rather than calling it on the other actor

worthy wasp
#

otherwise - you have to test 480 APP ID

brittle sinew
#

Then once on the server, call the method onto the other actor

worthy wasp
#

oh @ lethal - i think its backwards of what your thinking....

lost inlet
#

steam online subsystem uses peer to peer sockets by default

#

and you have to actually modify it so it works without p2p

worthy wasp
#

Raycast -> HitActor->HealFunction()

RECIEVING ACTOR:
HealFunction()->ServerHealfunct()

brittle sinew
#

Yes, I understand what you have currently. But you can't call a server RPC on an unowned object on the client

twin juniper
#

but is there a way i can sort of ping to see if my server is online

#

lol

worthy wasp
#

i'm calling the server RPC on the receiving client

#

not form the INSTIGATOR

brittle sinew
#

If you were testing that setup as the server, it would always work anyways, since the server has authority

#

Again, I understand what you have currently

#

I'm telling you that won't work

worthy wasp
#

sorry i'm not trying to argue you - trying to understand what i'm doing wrong

brittle sinew
#

You're attempting to call a server RPC from the client on an object you don't own.

#

That RPC call will not go through

#

Check out the tables on this page

#

You can call server RPCs on objects you do own. That's why I was suggesting to call the actual RPC on self, then once you're on the server, do what you need

worthy wasp
#

i see

#

and i see wher eyour saying i'm trying to call server on something i dont own (HitActor)

#

so i should Heal()->ServerHeal() (Which gives me HitActor)

ServerFireWeapon:
HitActor->Heal(Amount)->ServerHeal(amount) (because its a replicated value)

#

look right? (hopefully logic sonds right)

brittle sinew
#

The heal itself shouldn't be an RPC anymore

worthy wasp
#

that can happen locally - even though its a replicated variable its changing?

brittle sinew
#

You'll go this->HealActor(HitActor) where HealActor is a server RPC

#

Once on the server, go HitActor->Heal()

worthy wasp
#

yep thats what i'm doing now - ok

vocal ingot
#

How to implement shooting in a first person shooter?

#

Do I just reduce health on the server?

#

and then replicate it to everyone?

#

or do I have to do something crazy like reconstruct the world for that user and see if it actually hit and then reduce the health?

brittle sinew
#

Well, the last question would be somewhat towards implementing a lag compensation system, which isn't expressly required or anything

worthy wasp
#

@vocal ingot - simply ApplyDamage(TargetActor, DmgAmount) on the SHOOTER

On the RECEIVER:
AnyDamage() -> Decrement + death implementation

Dont forget to clamp your incoming damage float - or handle via <= 0

brittle sinew
#

If you reduce health (a replicated variable) on the server, it'll be replicated to all other clients

worthy wasp
#

look up the functions - theres mroe than just those params

vocal ingot
#

ok, thanks

#

so I don' t need to have a lag compenstation system?

worthy wasp
#

but its pretty painless - blueprints

vocal ingot
#

like I don't have to reconstruct world in the server and see if it actually hit?

worthy wasp
#

dont get me wrong - its a good feature (the lag compensation) but tha trequires a bit more advanced programming

vocal ingot
#

ok 😛

worthy wasp
#

i read an article about it called (playing in the past)

#

everything happens a frame or 2 behind - so calculations are acurate

#

so wehn you aim a headshot - you actually hit a headshot

#

the problem is - on the actor that receives the headshot... he maybe a frame or 2 AHEAD of the actual headshot on his PC... and suddenly dies when he sees he was clear of danger.

#

typically - when in running motion

worthy wasp
#

i've been wondering this for some time - and i cant seem to get a working solution.... I have a TextRenderComponent (or widget) above an actors head. I want to rotate this actor to always face the LOCAL PLAYER (you playing the game) - but not rotate for others..... maybe even considering this INSTANCING of this component?

Does this make sense... basically the component rotates every player INSTANCED. Do i need to handle the component differently - maybe spawn an actor and own it via the PAWN/Controller and handle turning in the pawn/controller script for each local player that is in range? Or is there a way to do it all on this actor?

severe widget
#

The rotation of the component should only be done on client, and in fact the component shouldn't replicate and could probably be client-only (added in client code)

worthy wasp
#

so simply turning off replication on teh component - but still rotating it via Tick - this would work @severe widget ?

void canopy
#

what possible logic could be for sharing all players position to a single client for the mini map position purpose ?

vocal ingot
#

@void canopy loop through every ACharacter (assuming your pawn is character) and get it's location

#

Locations and rotations of a replicated actor are already replicated

#

Use that and get all characters

void canopy
#

@vocal ingot Thanks for the reply. I'm getting player controller on game mode. From Pc I'm getting Pawn and casting to mycharacter class and then getting location of it.

vocal ingot
#

Not necessary

#

That won't work for clients

void canopy
#

Then I'm saving this value to that PC->playerstate position variable. Hoping when this variable replicate I will see its changes on client side. What method you suggest

#

Yes, I'm Indian 😃

vocal ingot
#

Your method is overcomplicated and not correct. You're also wasting unnecessary data

#

In event tick, loop through every character using iterator

void canopy
#

Okay, what could be the possible solution you suggest for this scenario, I want the position of each client connected to server to every client as I've a mini map there where I will position these clients.

vocal ingot
#

And then just get it's location

void canopy
#

Okay what should I do after getting the values of character position.

vocal ingot
#

Use it in your mini map?

void canopy
#

these character position I got are on the server , not on the client, I need to find a way to send it to client

vocal ingot
#

Getactorlocation and getactorrotation

#

...

#

When you play in unreal editor with 2 players

void canopy
#

FConstPlayerControllerIterator iterator = GetWorld()->GetPlayerControllerIterator();
while (iterator)
{
AVizPlayerController * pController = Cast<AVizPlayerController>(iterator->Get());
if (pController)
{
FVector characterposition = pController->GetPawn()->GetActorLocation();
FRotator characterRotator = pController->GetPawn()->GetActorRotation();

        FVector characterLookAt =  characterRotator.Vector();
        
        AVizPlayerState* pstate = Cast<AVizPlayerState>(pController->PlayerState);

        pstate->SetCandidatePosition(characterposition);
        pstate->SetCandidateLookAt(characterLookAt);
    }
    ++iterator;
}
vocal ingot
#

Delete that

void canopy
#

I set the value of Position in playerstate and mark this position as a replicated variable

#

what should I delete ?

vocal ingot
#

When you play in unreal editor with 2 players, did you notice that it supports networking i.e when you move in client 1 it also moves on client 2?

#

Did you not think there must be

#

Someway unreal already knows position of all players

void canopy
#

I know that is happening, I want the position so that I can show it in mini map, I can see them moving that is true

vocal ingot
#

You already have a data of all players position

#

So first of all delete your method

void canopy
#

Position as a variable, unreal is already doing it in background, need to know where it is on client side

vocal ingot
#

You already know, get THAT actor which other player is controlling

#

And get it's location

#

The actor which is in your local acreen

#

Which is a remote actor

void canopy
#

Okay, got it, I should be focusing on how to get other client position values to a single client in a variable which I can use it in my mini map widget

#

Whole of the logic should be client side only

vocal ingot
#

Get locations of all actors which are not locally controlled

void canopy
#

true.

void canopy
#

Roget that

vocal ingot
#

And use ACharacter

void canopy
#

Any particular way to find out other controlled actors

#

I've different classes of actors getting possesed

#

some are specator class, some are pawn class, some are from acharacter class.

vocal ingot
#

They are still deriving fr ACharacter

#

Oj

#

I

#

Then

#

Use pawn

#

I guess spectator is also pawn? Check in source

void canopy
#

okay checking.

vocal ingot
#

ACharacter derives from pawn so pawn will work

void canopy
#

okay got it

#

thanks for the great help.

#

Looking forward to this solution

#

you working where in india ?

vocal ingot
#

Not working

#

Just completed high school

raven holly
#

Is UE UDP or TCP 7777?

#

ah udp

lost inlet
#

lol why would it ever be TCP?

raven holly
#

¯_(ツ)_/¯

#

shh

#

Do you guys tweak your "MaxInternetClientRate=10000" setting?

chrome bay
#

My dudes

#

Any idea if replication of custom types works?

#

I need an array of a 256-bit long type, so something like a long long long long char

#

which is basically what uint8 / uint16 etc. are under the hood

lost inlet
#

i'm pretty sure only certain integer types are supported

#

what are you doing that requires 256 bit ints?

chrome bay
#

nevermind, refactored what I was doing.

#

It's for team affiliations, hard to explain - but it serves as a mask for a range of values in the uint8 range

#

just limited the maximum number of teams to 63 and using a uint64 instead. Probably more than reasonable...

long hollow
#

anyone know if the steam test app id is region locked? for example 2 players, 1 in U.K other in Germany .. but not finding a session ?

slim holly
#

afaik no

#

it doesn't always work tho

#

so remember to try few times

long hollow
#

will do, tnx, been trying for a while now but nowt working, pretty sure the code is solid though

slim holly
#

oh and

#

make sure you get plenty of results

#

in the ui

#

I think it might be bugged

#

like mismatching data still counts as search result

#

not sure tho

long hollow
#

oh, i had it as 50, then upped to 200, should i up it some more ?

slim holly
#

no idea, I just set it to 900

long hollow
#

hah oki ill crank it up

#

thankoo 😃

slim holly
#

🤔

#

I should add ghost trail to crosshair that shows how much latency you have

long hollow
#

oo

#

now thats a neat thought 😄

stoic maple
#

If I want my variables replicated so that I have replays in a single player game, what would be the best replication condition to select on the variables in the blueprint? (The game/simulation could end up going to multiplayer at some point as well, but that isn't the focus right now)

jolly siren
#

@stoic maple they added new conditions for that, they aren't really documented yet

#

COND_ReplayOnly

#

COND_ReplayOrOwner

#

in 4.12

slim holly
#

eXi did add them to his compendium tho

#

see pinned messages

jolly siren
#

ahh nice

long hollow
#

@slim holly thinking about that idea you had, how would you actually do that? 😐

slim holly
#

well, Lerp over latency time in short

slim holly
#

yea I just tested it

#

should work just fine using replication delay

twin juniper
#

so

#

why does seamless travel not seem to do anything

#

i was under the impression that when u enable it

#

it makes it use the transition map while loading the map

#

yet mine doesnt seem to make any difference

#

am i doing something wrong?

hollow quartz
#

Does anyone have any experience sending lots of data to the client via RPC functions? I'm wondering about the feasibility of using RPC to stream data in chunks to the client. If I tried to send a lot of data over RPC, would the engine do packet splitting on its own?

stoic maple
#

@jolly siren Thanks, I saw those but the lack of documentation made me hesitate on using them.
I guess ReplayOrOwner would be my best bet.

jolly siren
#

Ahh yeah it's just because they are new

modern dome
#

Hey there, I want each player to have it's own statistics like Distance Travelled etc.
Is the PlayerState the correct Place for this?

#

Is Get Player Pawn (0) correct? Because PlayerState gets replicated and I'm unsure

slim holly
#

@hollow quartz yes, and it doesn't really work. while it's really fast it also saturates the network and freezes everything for extended period of time

#

@modern dome no, use owner to determine the proper controller

hollow quartz
#

@slim holly alright, thanks. Even with the RPC calls throttled?

slim holly
#

you can throttle them, but it wont be any faster than using regular replication then

twin juniper
#

Hey so for some reason, my server just crashes if it tries to spawn an actor that is stuck in a wall or something

#

instead of just forcing the spawned actor to move out of the blocked area

#

how do i fix this

#

lol

slim holly
#

maybe spawn it not-inside a wall?

twin juniper
#

i cant control that

#

the player can do it

#

its apart of the game

hollow quartz
#

I was experimenting sending RPCs with a timer, which was faster than actor replication but I haven't send enough data to see any negative effects yet. Do you know if I make an RPC call with a big struct of data, will the engine split the packet on its own?

slim holly
#

I would assume so

#

however, the side-effects I got were nonsensical delays on other replications

#

up to 30seconds

#

I debugged the bandwidth usage, it just flatlined

#

not even forced network update went trough

still coral
#

hey guys i have a question. Let's say i have a session with x amount of players and each of them has a WidgetComponent in World Space. How do i make it so that each player has all the other players' widget components facing him?

hollow quartz
#

@slim holly Yeah I've seen that behavior with actor replication, didnt know if heavy RPC usage would also have that effect. Good to know. I guess custom sockets really is the best way to accomodate data streaming. Hopefully it'll make it into the engine at some point, I know they have talked about making replication support it.

#

Im curious though, if replication doesnt do the trick because it saturates the network, wouldnt custom sockets also have the same effect, but with the added negative side effects of neither system knowing about each other

slim holly
#

probably, but I would assume it fixes itself once the transfer is complete

#

while RPC issue occurs after the transfer

hollow quartz
#

Did you tweak any of the bandwidth ini settings?

slim holly
#

tried, but it didn't take effect

#

it always defaults to 10000

hollow quartz
#

Yeah I found a way to make them work, it was a different property than the 10,000 one, can't remember the names right now

#

I believe you have to change MaxClientRate and ConfiguredInternetSpeed

slim holly
#

using the OnRep buffer for transfer wasn't too bad

#

that's about 8MB map

hollow quartz
#

not bad

twin juniper
#

any of u guys gotten voice chat to work

slim holly
#

haven't gotten that far

hollow quartz
#

Did streaming that affect the server performance?

slim holly
#

afaik no, it's using the allocated bandwidth for the client

hollow quartz
#

and thats using regular actor property replication?

slim holly
#

single variable OnRep loop

twin juniper
#

@slim holly so im curious... did u do this using seamless travel?

#

how are u having a loading screen like that

slim holly
#

no travel

#

or well

#

the client connects to same map, thus it seems there is no travel

hollow quartz
#

Single variable as a buffer? Thats really interesting, so the server is sending 1 block at a time? How is the client notifying the server that its ready for the next block?

slim holly
#

100 blocks at the time

hollow quartz
#

oh ok, chunked a bit then

slim holly
#

yea client tells server when onrep is triggered so it knows to send next chunk

hollow quartz
#

yeah thats pretty clever

#

i have a feeling i can get more data transferred straight through RPC instead of property replication

slim holly
#

yea that download is like 2 sec when I use rpc

#

but the replication freezes for 20sec after that

hollow quartz
#

because of the client bandwidth limit eh?

slim holly
#

I assume it goes beyond that

#

by a lot

hollow quartz
#

did you throttle the RPC calls at all?

slim holly
#

I think there was a mention about saturating connections and about engine dropping stuff on purpose

#

something about replay protection

hollow quartz
#

interesting

slim holly
#

I assume this was issue back in UE3

#

clients crashing servers maybe

hollow quartz
#

that might be fine when streaming a level in, but not so great for streaming chunks on the go, I'll have to see how far I can go with throttled rpcs

#

really want to avoid all the effort and boilerplate using sockets brings

slim holly
#

try latency throttling

#

I got some interesting results using that

hollow quartz
#

monitor the player's ping and use that to control the send rate?

slim holly
#

ye

hollow quartz
#

good idea

twin juniper
#

so for some reason

#

two of my variables are not being read properly

#

-.-

#

nvm

#

c++ > bp

#

did the same code in c++

#

and it works now

raven holly
#

Why does limiting FPS at 60 reduce rubberbanding?

slim holly
#

you're using tick to update something

#

tick is bound to frametime

raven holly
#

hm

#

nothing on tick is networked i believe

#

doing a profile now

#

Could be related to replicating aim offset

#

The bottom bit doesnt work so I use a rotator which is set when offset is changed

#

It was called 17,000 times

#

Its not a reliable function though

#

I wonder if I should move 'set server rotator' to a delayed tick

#

every 1 second or so

#

And on the server, so no RPC

#

I guess these spikes are the rubberbands right?

#

or when it hits the MaxClientRate

raven holly
#

What happens on 200 ping

#

if i strafe walk backwards etc

#

a rep notify happens on client and server right?

obtuse zinc
#

Hey guys, so in my game, the player is assigned a team when they join the server, and their weapon is based off of what team theyre on

#

I'm not sure what the best way to go about this is, because the server has to know which teams everyone is on, so that means gamestate and playerstate, but the player controller also has to know to determine which OnFire method to call

brittle sinew
#

It shouldn't, if you have all of the weapons based on a common parent

#

Sure, you might have to do some weird handling if you have different types of weapons, but those should be handled on the weapon itself, not the PC

obtuse zinc
#

Hmm, so i have 2 types of "weapons" but theyre not really weapons, since you can't pick them up or drop them. theyre just innate to your character depending on which team you are on. One team gets a railgun, one team gets rocket launchers

twin juniper
#

PLOX

#

PLOX

#

PLOX

#

PLOX

#

PLOX

obtuse zinc
#

yes lexmark?

brittle sinew
#

In that case, I would make sure your characters inherit from a parent declaring OnFire

#

That seems like a little bit of a weird case to juggle around though, and it might not be optimal

obtuse zinc
#

hmm. So i originally had it where the 2 different teams had 2 different models and classes that did the same thing (Based on a parent class) but the only difference was their OnFire methods were different

#

But I wanted to get rid of that architecture because I could see it leading to issues when I get farther with the fact that every round, the teams switch weapons

brittle sinew
#

Yeah

#

At least currently, you could just call the parent OnFire method then

#

You wouldn't need to know which one to call

obtuse zinc
#

hm, but if i need two different fire methods, because of the different "weapons", if both teams use the same class, how do i determine if I want to shoot rockets or a rail?

brittle sinew
#

I'm a tad confused with your setup, are the two characters two different subclasses based on the same class?

#

Or are they using the exact same class?

obtuse zinc
#

No they used to be 2 different subclasses, now they're the same class

#

Because the only difference was the onfire method, and the teams switch sides every round, which means they switch weapons every round

#

Thought it might make more sense to just have one class and then when I fire all i'd do was check my team

brittle sinew
#

Sure, if you're doing the checking on the character itself you wouldn't have any need to worry about what method you're calling

obtuse zinc
#

Yeah, so I guess what I'm asking is: I'm just assigning a PlayerController a team number when they join the server, when my actor character fires, it should be able to check the team number that's stored in the player controller and fire the correct weapon right?

brittle sinew
#

Yes, that seems like a valid solution at this point

#

Your architecture seems a tad weird (personally I would delegate the weapon handling into its own class that the character can own), but that would work 😃

obtuse zinc
#

Yeah it definitely feels awkward

#

You're saying make a weapon class with subclasses rocket and rail, and then have the player own a weapon based on their team, so they just call fire on whatever weapon theyre "holding"

brittle sinew
#

That's how I would probably do it, yes

obtuse zinc
#

Okay I'll give that a shot

#

Not really getting anywhere with my way

#

thanks!

slim holly
#

LogRep: FRepLayout::UpdateChangelistHistory: History overflow, forcing history dump RecoilChar_C

#

ah I see, replication variable changin too often

#

anyone done doublejump on multiplayer?

worn nymph
#

Anyone know how I can implement a taunt mechanic . So basically when player A taunts player B he cannot control the character and instead moves towards the character that taunted him . Stopping the input is easy but how would I make a player controlled player move without inputs ?

slim holly
#

that's one way to do it, or let AI possess it momentarily

#

first option is probably better, since unpossessing could cause some owwnership related issues

worn nymph
#

@slim holly what's one way to do it? That was my question how would I do it

slim holly
#

do a script that overwrites player input momentarily

worn nymph
#

How would I do that . Everything a player does is driven by input axis which would be stopped/disabled to stop the player moving . Maybe could use set actor location and timeline/lerp towards enemy position then enable input when it's in the correct place but then I need the animations to play too and also the enemy position would be changing so I don't think that would work .

slim holly
#

then dont disable the input, just do a switch to use one that points towards the taunter

chrome bay
#

@raven holly internally lots of things are sending RPC's on tick, especially Character Movement Component

#

Most of them are unreliable, so if you're flooding the bandwidth (looks like it) elsewhere, then it will start to rubber band more often.

#

I'm also fairly certain you don't need to replicate control rotation for aim offsets. Check Shooter Game Source Code (C++)

slim holly
#

Blargh, Client side physics simulations

raven holly
#

@chrome bay ❤

#

Ty for your insight

twin juniper
#

i love how flexible "onrep" is, but i only just realize how much i use it. most of my onrep stuff is cosmetics that i want to sync up to players but its not at all important. how does this hold up when some things need to be unreliable? like is it possible to flag onrep stuff be qued as unreliable like functions?

brittle sinew
#

That doesn't really make sense in context...OnReps depend on replicated variables, which are "reliable" (I guess?) by default

#

No guarantees when info will arrive, but the variable changes don't get dropped

#

You could just use unreliable RPCs, if that's something you want

mild zodiac
#

I can't get voice chat in shooter game to work. It says Error: StartLocalVoiceProcessing(): Device is currently owned by another user

slim holly
#

uh, I'm quickly running out of ideas how to launch clients character smoothly

slim holly
#

also the engine politely ignores my request to ignore movement correction

#

and jerks the character anywway

wise depot
#

any of you guys done any work with the OnlineAsyncTaskManager at all?

#

turns out unreals implementation of steam stats is just terrible

fleet sluice
wise depot
#

well i'm trying to integrate achievements and stats since unreal's achievement thing doesn't suppost progress achievements

OnlineAsyncTaskManagerSteam holds the internal function responsible for handling OnUserStatsReceivedCallback, which is where the achievement data for hte player is contatined in the callback BUT the default implementation for this doesn't actually use the achievement data at all and I'm not 100% sure if its safe for me to just rebind the delagate to something locally so I can handle it myself

#

infact thinking about it I don't think we use any of the default implementation for steamworks at this point. I'm using the Advanced Sessions plugin to handle sessions now, we have our own functions for leaderboards since the defaul implementation for those was horrific too. And now i'm working on this aha

slim holly
#

so, there's no way for client to override actor location while replicating?

wise depot
#

Yeah, just do an authority chck

#

I think it's ROLE_AUTONOMOUS, if it's that then ignore what the server says

#

Or add your own custom shit to handle what the server says

slim holly
#

ok this doesnt make any bit of sense

#

I do simulated character launch on both client and server

#

client set mesh to follow the predicted trajectory, while server set actor velocity based on trajectory

#

why is it still jerking

weak meteor
#

anyone got any examples of NetworkPredictionInterface for a basic component? I can't find anything outside of character movement component, which is a bit too heavy to get to grips with it

surreal prism
#

Hi, if i call two multicast methods in function body, they can be delivered with wrong order?

#

because UDP can)

weak meteor
#

I believe if they are marked as reliable they will be in the right order

slim holly
#

so, anyone know good doc on smoothing movement on client side?

hollow pond
#

I can't fire the eTravelFailure on server travels, is there anyway to do that? =p

thin stratus
#

Could it be that the ServerTravel only calls that on the Server?

#

The TravelFailure I mean

#

And you try to view that on the client?

surreal prism
#

@weak meteor thx 👍

hollow pond
#

@thin stratus Yeah, but the error handling function is on the GameInstance, so when I override it on client or server I should get a response, right?

thin stratus
#

Technically, yes

hollow pond
#

So, nothing happens =/

#

Maybe the TravelError is just called with OpenLevel and not server travel

#

Or maybe is just called using c++? I'll give that a try

hollow pond
#

Does anyone know or can point me to somewhere that I can learn about downloading maps/content from servers to clients to use in-game?

fleet sluice
#

@hollow pond UnrealTournament source code. It's built using UE's built-in HTTP request framework. It's a bit of a mess but it's a good start.

hollow pond
#

@fleet sluice Thanks!

fleet sluice
#

Np

lean cedar
#

does anyone know about a solution for voip on UE4?

jolly siren
#

Does anyone know the first place the world is guaranteed to be fully setup after travel?

jolly siren
#

on the client

jolly siren
#
if (PlayerController->HasClientLoadedCurrentWorld())
{
    HandleSeamlessTravelPlayer(Controller);
}```
#

It seems like HandleSeamlessTravelPlayer

#

but I'm running into issues where I'm getting null back for an actor that is placed in the world when I try to find it in HandleSeamlessTravelPlayer

#

it only happens sometimes tho

surreal prism
#

Hi. someone know why it's happens
I'm have a replicated actor - Tree
I'm spawn the Tree on server side, but on client it's replicates with little offset

#

because location value is rounded

#

Top line - Client, two line below - Server

#
GetWorld()->SpawnActor<AFoliageSwapActor>(SwapClass->Get(), Transform);
raven holly
#

@surreal prism check actor replication settings

#

there is rounding settings there

surreal prism
#

@raven holly yes, found, but it have RoundTwoDecimals Max 😉 can't disable it completely 😉

slim holly
#

🤔 how would one replicate recoil for client visuals?

raven holly
#

why?

#

fake it with animations

#

a fire anim

slim holly
#

ye, but I kinda like the CS:GO approach where you don't necessarily see the hit, but accurate trail where it went

#

and I should be more precise, Im talking about bullets, not animations

lost inlet
#

source based games don't do recoil on the server

#

the client predicting the shot does the recoil

#

also for bullet spread, source games are also able to achieve this because the predicting client has a shared seed with the server

#

also recoil =/= bullet spread

jolly siren
#

Does anyone know why actors would fail to spawn after seamless travel? It only happens sometimes

#
[2017.05.05-01.15.57:784][532]LogNet:Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: NULL, Channel: 3
[2017.05.05-01.15.57:784][532]LogNetPackageMap:Warning: SerializeNewActor: Static actor failed to load: FullNetGuidPath: [1659]/Game/Maps/Foo.[1657]Foo.[1655]PersistentLevel.[1661]WorldSettings_1, Channel: 4
[2017.05.05-01.15.57:784][532]LogNet:Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: NULL, Channel: 4
[2017.05.05-01.15.57:785][532]LogOnline: STEAM: Player erebel55 [0x110000104F771D1] already registered in session Game
[2017.05.05-01.15.57:785][532]LogNetPackageMap:Warning: SerializeNewActor: Static actor failed to load: FullNetGuidPath: [1659]/Game/Maps/Foo.[1657]Foo.[1655]PersistentLevel.[1675]Foo_C_0, Channel: 7
[2017.05.05-01.15.57:785][532]LogNet:Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: NULL, Channel: 7
[2017.05.05-01.15.57:786][532]LogNetPackageMap:Warning: SerializeNewActor: Static actor failed to load: FullNetGuidPath: [1659]/Game/Maps/Foo.[1657]Foo.[1655]PersistentLevel.[1681]BP_Barrel6, Channel: 9
[2017.05.05-01.15.57:786][532]LogNet:Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: NULL, Channel: 9```
#

These are actors placed in the level in the editor

twin juniper
#

So

#

can widgets call Server functions?

#

im trying to make a button

#

where when u hover over it

#

it destroys an actor

#

yet it doesnt seem to be getting called

brittle sinew
#

Are you trying to call a server function on self?

#

On the widget

twin juniper
#

oh no

#

so u know how i have a Structure class? I want to be able to call my "Server_DestroyStructure()" function from a button

lost inlet
#

call a client->server RPC on the player controller???

twin juniper
#

so i give it a reference to the structure

#

hold on

brittle sinew
#

Is that structure an owned object, however?

twin juniper
#

to the left

#

is uhm

#

"OnHovered"

#

for the button

lost inlet
#

well you have to be the netowner of an actor to call an RPC from the client

twin juniper
#

the function is in cpp

lost inlet
#

you can do that if you wish, or proxy it through the player controller which you will always be the netowner of

twin juniper
#

and it literally just deletes the data from the database then calls Destroy()

#

lol

#

idk

#

what am i donig wrong tho lol

#

it seems to make sense to me

lost inlet
#

i just literally told you

twin juniper
#

im calling the function

#

the function is on my structure class

#

ohh

#

wait

#

so i cant call it because it was spawned in?

#

but wait

lost inlet
#

you don't have net ownership of the actor

#

so you can't call server RPCs on it

twin juniper
#

then why couldnt i call ApplyDamage(bp version of TakeDamage())

lost inlet
#

the log output will even tell you this if it's the case

twin juniper
#

lol

#

like when i left click

#

i can call ApplyDamage

#

but i cant make a button call ApplyDmg?

lost inlet
#

ApplyDamage isn't even an RPC iirc

twin juniper
#

ya

#

but it has to be called

#

on the server

#

See that little pc icon

#

it means u have to clal it on the server

#

lol

lost inlet
#

i know what the authority only thing is

#

but i'm telling you that YOU MUST BE NETOWNER TO CALL RPCS ON AN ACTOR

#

if you're not, the RPC fails

twin juniper
#

but... i called it on my ACharacter as well

#

ill try playercontroller i guess

lost inlet
#

you have net ownership of your character

#

so RPCs will work

twin juniper
#

yea but it didnt

#

when i called it on my character

#

same result

lost inlet
#

then something might be wrong with your RPC

#

well you can be certain if you add a breakpoint to the _Implementation function

#

also make sure you are testing your stuff in dedicated server mode, if not your client has authority and can do whatever

full bane
#

@twin juniper it looks like you are trying to call ServerDestroyStructure from within the widget

#

pretty sure the widgets don't have any netownership

#

so you have to route it through the PlayerController or Pawn to work

twin juniper
#

yeah

#

thats what @lost inlet was saying

#

so i basically would have to do GetplayerController()-> Servver_DestroyStructure(Mystructure);

full bane
#

yes

twin juniper
#

ignore typos

#

lol

#

about to test this

#

lol

#

ok well im an idiot

#

that works lul

#

ive had that same mistake before

#

gonna take me a while to get it in my head

hollow pond
#

Bdoom

#

@twin juniper , Have you seen Cedric's networking compendium?

twin juniper
#

yeah ive read it

#

i just always forget simple stuff

#

:p

hollow pond
#

Yeah, I know the feeling, haha. Same here

obtuse mango
#

Would this be the best place to ask a question reguarding ue4 and mmos?

bleak cloud
#

Can anyone link me some resources on integrating steam subsystem? Got it working through blueprints in a test project, looking to switch over to c++ next and get join on friends working.

slim holly
#

@obtuse mango sure, tho success not guaranteed

raven holly
#

How would you profile CPU on a dedicated server?

#

🤔

raven holly
#

hmm

thin stratus
#

You should still be able to use the DediServer the same way you use the client

#

It should also accept Console commands

#

So even if you can't enter them into the CMD, you could still, technically, perform it by default somewhere on beginplay

#

So if UE4 has a way of profiling CPU with a file (similar to how networking is profiled with a file you can view afterwards), it should be straight forward

quartz totem
#

For a multiplayer 6DOF game, would I be better off trying to adapt Character, or adding networking support to a pawn with a floating movement component?

chrome bay
#

Be better off writing your own Movement Component altogether

#

speaking from experience

#

Big task, but worth it IMO

quartz totem
#

What have I gotten myself into?

#

Are there any good resources, or should I just start going through Character and Character Movement Component?

chrome bay
#

Just start working through it. I warn you now though it takes a lot of understanding, I've done it a couple of times now 😦

quartz totem
#

I've got this. CharacterMovementComponent is a mere 9800 lines.

slim holly
#

we should just pool in some resources and make like few different movement components for different uses

#

plenty of games require aerial movement, yet default movement doesn't really support it

twin juniper
#

So my friend crashed on the client

#

but when he tried to reconnect

#

it wouldnt let him in

#

keeps saying

#

"No Servers Found"

#

lol

bleak cloud
#

@slim holly Thanks! I'll give it a look through!

timid nebula
#

anyone have some links to good tutorials for setting up basic multiplayer functionality?

jolly berry
#

Speaking of which, I used this to setup the multiplayer menus for my game, however when I play a match out with friends, return to the main menu and recreate a new match, the clients have to restart in order to find the game, otherwise it just says search failed

#

does anyone know why that bug might happen? Like a match being created, completed, and then not found by clients who haven't restarted the game?

slim holly
#

I'd guess Session is not terminated properly @jolly berry

jolly berry
#

DestroySessionCallback - Invalid player state

#

sometimes I get this

#

in my logs

#

is there like a way to test the function properly in the editor

#

cause like I don't want to have to build and ship the product to friends everytime i wanna debug this stuff

jolly berry
#

[2017.05.08-07.39.08:117][615]LogScriptCore:Warning: Script Msg: DestroySessionCallback - Invalid player state [2017.05.08-07.39.08:117][615]LogBlueprintUserMessages: [GameInfoInstance_C_0] [2017.05.08-07.39.08:117][615]LogBlueprintUserMessages: [GameInfoInstance_C_0] Success INFOINSTANCE @@@@@@

#

hmm

#

it succeeded though

wary wyvern
#

Hey guys! Is it possible to replicate an actor to Owner only?

full bane
#

nope

#

you can replicate every Actor that has bReplicates set to true

wary wyvern
#

Damn(

full bane
#

only thing to consider is that RPCs need a valid Owner to work

#

exception is NetMulticast

#

which works without owners

wary wyvern
#

I know there is Owner Relevancy. But thats not exactly what I want

full bane
#

oh, I might have misread your question

#

you only want to replicate to the owner of that actor?

wary wyvern
#

Yep. I want my actor to be replicated to owner only, so no other client knows about it.

full bane
#

there is a flag

#

bOnlyRelevantToOwner

wary wyvern
#

Yep, I've set it. But it still will be replicated to others.

full bane
#

hm

#

pretty sure that is part of the relevancy check

#

and should not get replicated to other clients

wary wyvern
#

Well, In my opinion it should. But it will replicate to owner with more priority

full bane
#

might be overruled by bAlwaysRelevant

wary wyvern
#

What is the difference between "Only relevant to owner" and "Net use Owner Relevancy" ?

full bane
#

I don't know what Net use Owner Relevancy does tbh

#

never had a use for it

wary wyvern
#

Okay. Thank you)

fleet sluice
#

@wary wyvern those 2 options are exactly what you're looking for. Set "bOnlyRelevantToOwner" and "bNetUseOwnerRelevancy" both TRUE. Then, when you spawn your actor, you set its owner as an actor which only exists on that client (i.e. PlayerController)

#

Also, I believe, but not tested, that "bNetUseOwnerRelevancy" exists to be able to provide control for non-multiplayer environment, like local split-screen

full bane
#

did they move the network code?

#

used be in APawn

#

but can't find anything in there

#

nvm, found it

#
bool AActor::IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const
{
    if (bAlwaysRelevant || IsOwnedBy(ViewTarget) || IsOwnedBy(RealViewer) || this == ViewTarget || ViewTarget == Instigator)
    {
        return true;
    }
    else if ( bNetUseOwnerRelevancy && Owner)
    {
        return Owner->IsNetRelevantFor(RealViewer, ViewTarget, SrcLocation);
    }
    else if ( bOnlyRelevantToOwner )
    {
        return false;
    }
    else if ( RootComponent && RootComponent->GetAttachParent() && RootComponent->GetAttachParent()->GetOwner() && (Cast<USkeletalMeshComponent>(RootComponent->GetAttachParent()) || (RootComponent->GetAttachParent()->GetOwner() == Owner)) )
    {
        return RootComponent->GetAttachParent()->GetOwner()->IsNetRelevantFor(RealViewer, ViewTarget, SrcLocation);
    }
    else if( bHidden && (!RootComponent || !RootComponent->IsCollisionEnabled()) )
    {
        return false;
    }

    if (!RootComponent)
    {
        UE_LOG(LogNet, Warning, TEXT("Actor %s / %s has no root component in AActor::IsNetRelevantFor. (Make bAlwaysRelevant=true?)"), *GetClass()->GetName(), *GetName() );
        return false;
    }
    if (GetDefault<AGameNetworkManager>()->bUseDistanceBasedRelevancy)
    {
        return ((SrcLocation - GetActorLocation()).SizeSquared() < NetCullDistanceSquared);
    }

    return true;
}```
wary wyvern
#

@fleet sluice Thanks! I'll try to enable both, will see how it goes)

fleet sluice
#

Just don't forget to set a proper owner or else it will not replicate at all

full bane
#

so apprently NetOwnerRelevancy means that the owner can decide wether or not to replicate

wary wyvern
#

Yeh, I set Player controller as an owner in the moment of spawn.

void canopy
#

@jolly siren hi are you still working on Voip ? I'm trying to establish voip on my lan in my clients

warm moss
#

hello, anyone here who can share the proper way of spawning player in a multiplayer setup using seamless server travel. I pretty confused with the given functions of game mode (Spawn default for, PostLog in, OnSwapPlayerController)

jolly siren
#

@void canopy I didn't do lan. I did steam.

rare cloud
#

I have a design problem with IGenericTeamAgentInterface, this is an interface used by IA to know if an entity is Friendly/Neutral/Hostile. We need to implements it to a controller BUT controller only replicate between owning client and server for a player and an AIController only exist on server.

#

for player I can move it to playerstate and all is good

#

I guess I will made some stuff on Pawn directly

pine sentinel
#

Hello! I have one question. I want to make a multiplayer game where there is going to be two players. One which is a fps player going through corridors etc, the second one is going to be a minimap with just camera and some mouse functions (like move fps player to a specified location under mouse cursor). The question is, is it possible to make networking between two different projects? One project that is the fps player with all the meshes, material, levels etc. and another project that has only one plane with a minimap texture and camera. I want to connect the minimap level to the fps level so I can project the fps player location on the minimap. I need two project because that the minimap project could be a mobile verison and I dont need to package everything (file size will be very small).

#

Anything small like keywords or something like this that I can google it will help me.

#

Mainly the idea is to make a PC listen server and one mobile (Android) client to join the server.

#

Or logically is it possible to have a workable networking if I package the same level twice one which is the PC version that has all stuff, and the same level which will have the unnecessary stuff deleted from level and content browser?

jolly siren
#

@rough iron have you seen travel issues where actors placed in the level fail to load on the client sometimes?

#
[2017.05.05-01.15.57:784][532]LogNet:Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: NULL, Channel: 3
[2017.05.05-01.15.57:784][532]LogNetPackageMap:Warning: SerializeNewActor: Static actor failed to load: FullNetGuidPath: [1659]/Game/Maps/Foo.[1657]Foo.[1655]PersistentLevel.[1661]WorldSettings_1, Channel: 4
[2017.05.05-01.15.57:784][532]LogNet:Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: NULL, Channel: 4
[2017.05.05-01.15.57:785][532]LogOnline: STEAM: Player erebel55 [0x110000104F771D1] already registered in session Game
[2017.05.05-01.15.57:785][532]LogNetPackageMap:Warning: SerializeNewActor: Static actor failed to load: FullNetGuidPath: [1659]/Game/Maps/Foo.[1657]Foo.[1655]PersistentLevel.[1675]Foo_C_0, Channel: 7
[2017.05.05-01.15.57:785][532]LogNet:Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: NULL, Channel: 7
[2017.05.05-01.15.57:786][532]LogNetPackageMap:Warning: SerializeNewActor: Static actor failed to load: FullNetGuidPath: [1659]/Game/Maps/Foo.[1657]Foo.[1655]PersistentLevel.[1681]BP_Barrel6, Channel: 9
[2017.05.05-01.15.57:786][532]LogNet:Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: NULL, Channel: 9```
jolly siren
#

or has anyone seen this issue?

loud wolf
#

"where actors placed in the level"

i think you need to spawn from the server for it to appear on the client

jolly siren
#

😒

#

no

#

Actors placed in the world will spawn on both server and client.

#

This works just fine, the issue is on travel and happens intermittently

rare cloud
#

you need to init it from server

jolly siren
#

what?

rare cloud
#

if you spawn an actor on client side, the client will see it yeah but server has no authority from this one and don't know its existence

jolly siren
#

I'm talking about actors that exist in the level. They were dragged and placed into the world in the editor.

rare cloud
#

oh ok

loud wolf
#

are the actors set to replicates?

jolly siren
#

that doesn't matter

#

sigh

#

This issue only happens like 1-5% of the time after doing a ServerTravel

#

For some reason the client isn't loading the world correctly when it happens

#

but as you can see from the logs it is attempting to

pine sentinel
#

Anyone on my question?

hollow pond
#

@pine sentinel You don't need 2 separate projects for that, do you?

#

@pine sentinel It maybe possible to do that using UE4, I don't know much about cross-plataform networking, but if the other guy is really just a map with buttons, you could sync the actions using another networking back end for that, like GameSparks or so

pine sentinel
#

this is what I was afraid of, I want pure blueprint solution.

hollow pond
#

GameSparks does have a pure bp solution for UE4, if it comes to that you just need to install its sdk and learn to use it

pine sentinel
#

I take my words back,

#

Yes I saw that now

hollow pond
#

But that may be possible, I was working on a android project a while ago and managed to start a server on a pc and connect with android for some time, didn't manage to replicate that afterwards so it may be possible to do what you're saying only by using a single ue4 project

#

but you should really look into cross-plataform-related stuff

pine sentinel
#

mhm, yes, my main concern is the file size. If its required to have the same level on both the platforms, just converting the PC version which is over 5 gb to a Mobile version is not going to work. It will require deleting a lot files from the content browser for the mobile version.

hollow pond
#

Do you really need the level on both plataforms?

pine sentinel
#

I dont know, thats why I ask around for suggestions. 😃

hollow pond
#

Haha, if you're just controlling a map, try rendering a top ortographic view of the map

#

and create like a minimap photo from that

pine sentinel
#

mhm