#multiplayer

1 messages ยท Page 570 of 1

vagrant saddle
#

yeah that's true

unkempt tiger
#

using that approach means your game runs slower with lower framerate, but its logic is consistent no matter what

vagrant saddle
#

yeah that's what I was going for

#

but i see why that doesnt work with networking

#

So, the server should be calculating everything right?

#

Then telling the client how to move

unkempt tiger
#

it depends on your game, what are you going for?

vagrant saddle
#

an fps arena shooter

unkempt tiger
#

an FPS shooter requires fast response times for the client

#

press W and the user should move immediately on the next tick on their screen

#

saying that the server should be calculating everything and telling the client how to move is vague, but partially true

#

the server (in most cases, probably yours as well) is the eventual authority and decides what actually happens

#

but so that the client doesnt have to wait like 0.1 seconds between pressing W and actually moving on their screen (which is about the time it takes for the client to send the 'move forward' input to the server, the server processes the request, and sends the eventual position back to the client), the client instead predicts the position the server will send back, and moves there immediately

vagrant saddle
#

and if that position is wrong then the server does something about it?

unkempt tiger
#

if the position predicted by the client is wrong, then the client corrects itself

#

its an intricate topic that I can't detail here and right now, theres a lot to be discussed

#

dont let that scare you though, its relatively easy to implement

#

you should google it and read up

vagrant saddle
#

I will, but can I ask something else that may be a familiar problem?

unkempt tiger
#

sure

prisma crescent
#

Look at CharacterMovementComponent. It handles a ton prediction for fps movement.

vagrant saddle
#

I have it so the client and server are calculating velocity, but when a client actually moves it's very jittery, is this because both the client and server are setting velocity each frame and I need to set it up so that the server only sets it at certain times ?

unkempt tiger
#

I can't say

vagrant saddle
#

Alright

unkempt tiger
#

there are too many possible reasons that can result in jitters

vagrant saddle
#

Its something I can't find on google either lol

unkempt tiger
#

eventually almost every networking problem ends up as jitter on your screen

#

it can be a one line fix or a fundamental flaw in the system's design

vagrant saddle
#

it's weird because the animation that is based off the characters movement speed is also glitching out, as if the speed isn't staying consistent

unkempt tiger
#

if the animations are driven by parameters that are experiencing jitters, like position or velocity, then it's expected if the networking is bugged, not weird

#

fix the networking, and the animations should smooth out

vagrant saddle
#

alright

#

thanks for all the help

prisma crescent
#

Are you doing movement with simulate physics?

vagrant saddle
#

not ue4's actual simulate physics but's working as if it's simulating a physics equation

#

like the velocity function is essentially doing v = v_i + a*t

#

except with a bunch of rules

astral fossil
#

Hey guys! Does anyone know how to execute a servertravel with fade out / fade in ? The client instance does fade out, but then it flashes the scene before going back to full opaque and fading in again (I guess the pawn is becoming unposessed)

prisma crescent
#

The character movement component saves a bunch of movement input snapshots with timecodes on the server and sends them out to clients so that they can recreate everything that happened 50ms/100ms ago. Use last input info to predict further movement.

While recreating that movement the client may receive another movement update interrupting this sequence, or adding more info to the sequence.

That's for updating remote players to clients.

For a client, the same movement input snapshots are collected and sent off to the server for correcting movement (assumption), but ultimately the client dictates what happens to the character locally and you hope its in sync with the server (and players are not cheating).

vagrant saddle
#

So should I be having the server calculate this every frame? I'm confused on how I'd let the client be in control while the server is doing its thing. With the way I have it set up it lets the client get its next velocity first then sends inputs to the server, but I think this might be causing the jitteriness. The server is setting the server's movementcomponent->velocity to what it gets each frame, should it not be doing this?

#

because if it doesn't, the character wont move

#

or maybe it does actually

#

nvm

prisma crescent
#

https://docs.unrealengine.com/en-US/Gameplay/Networking/Overview/index.html

Simulated Proxy
    

The Actor is a remote proxy that is controlled entirely by an authoritative Actor on another machine. Most Actors in a network game, like pickups, projectiles, or interactive objects, will appear as Simulated Proxies on remote clients.

Autonomous Proxy
    

The Actor is a remote proxy that is capable of performing some functions locally, but receives corrections from an authoritative Actor. Autonomous Proxy is usually reserved for Actors under the direct control of a player, like Pawns.

Setting up networked games for multiplayer.

faint seal
#

I've been testing this only as client. so now when i launch it as a listen server the server doesn't spawn the weapon.

vagrant saddle
#

Ah okay

faint seal
vagrant saddle
#

that actually helps a lot

winged badger
#

i'd say that it does @faint seal

#

that hand IK is wrapping around something there

#

even if you can't see it

faint seal
vagrant saddle
#

so are actors autonomous by default, or do you have to set it?

prisma crescent
#

You have to set it in CPP

vagrant saddle
#

ah okay

#

SetRole(ROLE_AutonomousProxy)?

winged badger
#

there is also nothing that would prevent listen server from running spawn logic there

faint seal
#

I found it, i left a owner no see node in from a previous iteration.

#

But at the same time the client could still see it with the owner no see checked

winged badger
#

i never use those, find them awkward

#

they are fine for an online tutorial

#

but i will always go for checking local control and SetActorHiddenInGame

meager spade
#

@vagrant saddle i wouldn't go round changing actors to autonomous

#

Autonomous is special

faint seal
#

I was messing around with having first person arms and third person mesh. Was a pain

winged badger
#

CMC will love ticking them skeletons on server if you mess with roles

vagrant saddle
#

It seems to make sense with what I'm doing though

meager spade
#

what are you doing?

vagrant saddle
#

networking custom movement

meager spade
#

yes but what?

winged badger
#

@faint seal in outliner you can choose which world you see (server/client..) via illuminati eye

#

so if you checked there, you'd see there is an instance of the weapon on the level

vagrant saddle
#

the character calculates its own velocity each frame

#

and would be corrected by the server if out of sync i suppose

#

and autonomous seems appropriate for that

meager spade
#

right.. but why isn't it autonomous

#

by default?

faint seal
#

Which worked for the actor/mesh's that i put on the character in editor. I couldn't find another way to do it with the guns i spawned at run time.

vagrant saddle
#

SushiToday at 8:24 PM
so are actors autonomous by default, or do you have to set it?
INV PYRToday at 8:25 PM
You have to set it in CPP

meager spade
#

pawns, possessed by a player controller become autonomous

vagrant saddle
#

ah okay

prisma crescent
#

They're not using a pawn

meager spade
#

if you are not using pawn, why not?

#

pawn is for anything that can move or have input logic

vagrant saddle
#

I'm pretty sure I am using a pawn

#

I dont think I ever said I wasnt

meager spade
#

so when a pawn is possessed by a player controller

#

it will convert the local pawn on the client, to autonomous

prisma crescent
#

Oh my b, mixed you up with someone else

vagrant saddle
#

oh okay lol

meager spade
#

to keep things synched

#

only the playing client should send input

#

server should then use that to calculate

#

client can move and server will also move, any reason you are not using the CMC?

vagrant saddle
#

Custom movement component right?

#

or character

meager spade
#

Character

prisma crescent
#

@faint seal I am taking the same approach and it is a frustrating setup

meager spade
#

if i was to ever make an FPS, it would be True FPS

vagrant saddle
#

I am but I set up a custom way of calculating velocity because I wasn't able to use acceleration the way i wanted to in CMC

meager spade
#

not a seperate arms/body

vagrant saddle
#

so like it's built on CMC which could also be an issue

meager spade
#

@vagrant saddle you can pass in acceleration tho

faint seal
#

@prisma crescent I gave and just moved the camera into the thirdperson mesh for the FirstPerson look

meager spade
#

and it can calculate it all for you

vagrant saddle
#

I have to set certain rules for calculating velocity, I'm not really sure if what I'm doing is using the CMC or not, because I'm just directly setting the character's velocity

#

I can just show you what the functions are

meager spade
#

RequestDirectMove

#

takes in a velocity

#

maybe thats for pathfollowing

#

tho i did some hacks ๐Ÿ˜„

prisma crescent
#

Creating a custom movement mode would help

vagrant saddle
#

I was thinking about doing that but I liked that the way we were doing it kept it working with CMC so that I wouldn't have to handle jumping and everything

#

cause I read custom movement suppresses all other things

meager spade
#

that is not actually true

#

you can still do the other stuff

#

you just have to handle it

#

whilst in your custom mode

vagrant saddle
#

So I could call Unreal's jump within it?

meager spade
#

sure but you would need to handle that

#

been a while since i read through the CMC

#

and i tend not to remember much of it, its a beast

vagrant saddle
#

am I able to actually read it's cpp file somehow? I can't find it anywhere

meager spade
#

in your ide?

vagrant saddle
#

yeah

meager spade
#

just open it

#

you have the source files for ue4

#

what ide

vagrant saddle
#

vs2019

#

it's in solution files right

meager spade
#

open your custom CMC derived class

#

and ctrl click on UCharacterMovementComponent

#

will take you to its header file

#

and yeah it will be

#

C:\UE_4.24\Engine\Source\Runtime\Engine\Classes\GameFramework\CharacterMovementComponent.h

#

is the location to mine

vagrant saddle
#

but no cpp?

meager spade
#

yeah switch to source

#

cant remember the shortcut lol

#

Ctrl + K + O

#

or something

vagrant saddle
#

wtf i had no idea you could just move like that

#

that's nice to know

meager spade
#

shortcut keys are time savers

vagrant saddle
#

I'm still confused on how I should be having the server handle this, cause currently I have it calling every frame like the client's movement calcs, and idk how else I'd do it

#

the client is moving but it's very jittery as if it keeps setting its velocity to 0

#

networking is silly

meager spade
#

btw i prefer rider, its soo nice compared to VS ๐Ÿ˜„

#

๐Ÿ˜„

vagrant saddle
#

I'm mostly using VS because I have a student license from my college

meager spade
#

ah this is free till feb 2021 ๐Ÿ˜„

#

i was beta testing it before the public beta, its come so far ๐Ÿ™‚

vagrant saddle
#

that's nice

prisma crescent
#

Pretty clean, how is the intellisence equivalent @meager spade ?

livid holly
#

is client-side prediction something you do only for autonomous proxies or can it be done for any simulated proxy? and who is in charge of client prediction if that's the case?

lucid vault
#

@meager spade Yeah, JetBrains' IDEs are awesome. Moving to VS for UE4 was depressing

#

Is Rider good enough to use as of now?

lost inlet
#

i say no, some disagree

fossil spoke
#

I gave it a go, didnt like it, it still needs to address stuff before id use it.

lost inlet
#

that's pretty much my experience with it. though that screenshot above doesn't really show any perks to use rider over VS

#

and resharper, which also powers rider, is usually the thing that slows down VS so

lucid vault
#

Just downloaded

#

All I can say is

#

This is awesome.

#

๐Ÿ˜„

lost inlet
#

so you made your decision that an IDE is awesome in about 15 minutes?

lucid vault
#

I've used Intellij for years

#

This is very similar

lost inlet
#

my condolences for having to be a java programmer

lucid vault
#

Indeed

fossil spoke
#

Does anyone know what the recommended way to play root motion animations for CMC is in a multiplayer setting? Do you only play it on the Server side or both?

analog rover
#

For the ability tasks in the Gameplay Ability System I think they play them on both sides

#

That being said they might have some additional code to make it work better

lucid vault
#

Is there an obvious reason why GetDefaultPawnClassForController isn't running in my gamemode?

fossil spoke
#

Did you set the correct Controller in the GameMode?

lucid vault
#

Yes, although I don't see why that effect whether or not that function runs?

#

Shouldn't that function run everytime a controller requests a pawn from the GM?

#

Ah

#

I added the override specifier, turns out it's not being overriden

#

No idea why. My GM is a child of AGameMode

#

Dude that's really weird. That function should be overridable ๐Ÿคทโ€โ™‚๏ธ

analog rover
#

According to the docs it is not virtual

lucid vault
#

I could have sworn it used to be

#

I used some function awhile back to achieve the same result

#

What is a good way for the game mode to determine what pawn to serve to PCs without this function?

chrome bay
#

@lucid vault You need to override the _Implementation version

#

Since it's a BP native event

twin juniper
#

hi guys, i'm new into unreal engine and i'm trying to follow an youtube tutorial to setup a server with unreal engine using my computer to host it and let connect another pc to it, i followed this tutorial https://www.youtube.com/watch?v=QGrRV-11sx4&list=PLG5XT5TF5T6iSpoYsFolz_fVKWRmsobDv&index=2 now seems that i was able to compile,build and packaging everything whitout any error, i can launch the server and run the game, i open 127.0.0.1 and server receive my connection, but still unable to connect from a different computer.

Hello guys welcome to another tutorial. Today I will show you guys how to compile a dedicated server for your own game. This will allow you to host your own server, and have anyone join it from across the world. I demonstrate this by putting the packaged final game on a usb an...

โ–ถ Play video
#

there is any way to debug or "ping" the server from another pc to see if server is receiving the connection?

#

also i see that im connecting to 127.0.0.1:53480 while in documentation it say that port used are 7777

#

i've forwarded on my router that port should i forward also that one?

verbal gust
#

you wont be able to connect via another computer on a loopback address

#

try configuring your network adapter to something like 192.168.1.2 and the other to something else with the same prefix and subnet for direct LAN testing

twin juniper
#

thank you i wil try i also noticed that when i try to connect it give me thie error LogLoad: Took 0.080499 seconds to LoadMap(/Game/Maps/MAPNAME) [9:39] NotifyControlMessage: Client connecting with invalid version. LocalNetworkVersion: 334850937, RemoteNetworkVersion: 2077486219 @verbal gust

#

im using ue 4.25.3 and i build source code with 4.25 release

#

i imagine i need to rebuild with that branch right?

verbal gust
#

any particular reason why you are working with the source code instead of prebuilt binaries?

twin juniper
#

i have very little knowledge in networking i followed the tutorial i've linked

#

and he compile the code from github

#

what is the main difference between that solutions?

zinc garden
#

Is there any good reason as to why map variables cannot be replicated?

#

as in TMap, not level ๐Ÿ˜›

chrome bay
#

Just very inefficient to do so most likely

#

also issues when using objects as keys etc

zinc garden
#

Alright, that is a valid issue

#

So for a scorelist, a good alternative would be... datatable?

#

or two arrays perhaps?

chrome bay
#

Array of USTRUCT

zinc garden
#

Alright that should work, thanks

chrome bay
#

Two arrays won't help because they'll be out of sync

#

Also suggest using FFastArraySerializer if you really must replicate an array

zinc garden
#

Oh, they aren't sorted

chrome bay
#

Since if you change array size, that elements and all elements after it are also replicated again with default array rep

#

Actually I need to lookup the specifics again.. but it's not ideal

zinc garden
#

This is all in BP for now, but I'll keep that in mind when porting it to c++

chrome bay
#

(also data table is strictly an asset-time thing)

#

If it's player scores btw, just keep those in the player states

zinc garden
#

Yeah, I did, but I can't access all player states from a widget it seems

chrome bay
#

You can

#

GameState::PlayerArray

#

Contains all active player states in the current game

zinc garden
#

Ah! Thanks!

chrome bay
#

np's

verbal gust
#

@twin juniper Just asking but personally i wouldn't want to deal with source code when their non-source code version does the job. Unless your doing something very specific

twin juniper
#

ok thanks, do you have any link of tutorial or documentation on how to use prebuild binaries? i'm very new into unreal sorry for bothering

chrome bay
#

You can't build a dedicated server without engine source is why

verbal gust
#

this guy is really good at explaining things related to network: https://www.youtube.com/watch?v=16BvKb-OPOg&t=293s

BRY

๐ŸŽฎ Unreal Engine Replication Series - Part 1: What is Replication?

๐Ÿ‘‹ Welcome to the Replication Series! This beginner tutorial series dives deep into how Unreal Engine handles Replication. Understand more than just the "how" and explore the "why" behind important concepts tha...

โ–ถ Play video
chrome bay
#

But then you probably don't need a dedicated server

twin juniper
#

yeah my idea is to try to setup a simple connection i don't care much about game itself, want to test out simple server setup if everything work smooth my idea is to migrate then all on a dedicate server maybe cloud , for now is enough to host on my local network

#

thank you i will take a look into that

whole yacht
#

not sure if im missing something small

chrome bay
#

You may also need to add it to PrivateIncludePathModuleNames

whole yacht
#

ah cool, thank you that solved the issue

worthy knot
#

@gleaming niche So i double checked the router settings, and there was an option "add port application" and then i clicked it, is this the part where i have to add the port 7777?

gleaming niche
#

Probably.

#

Yeah. I didn't see the screenshot. But youneed udp.

worthy knot
#

like this?

gleaming niche
#

Yep.

#

You can add a range if you want to test more than one as well.

worthy knot
#

okay i saved it

#

lol should i restart my router for changes?

gleaming niche
#

Shouldn'thave to.

peak sentinel
#

Virtual Joystick is only for playerindex 0 right? its not my replication problem?

gleaming niche
#

Player 0 is always the localplayer, in a client. Player controller etc on client side only exists for self.

peak sentinel
#

So why unreal chooses the latest client when running multiple PIEs?

#

Isnt all of them local in the theory in the dedicated server?

north kettle
#

is there a way to send rpc's to specific/select clients only?

meager spade
#

Client RPC

north kettle
#

ah sorry, i was referring to multicasts

meager spade
#

eh

#

you said "send rpc's to specific/select clients only" no multicast mentioned there..

#

and no not really

#

either the actor doing the multicast does not replicate to actors who are not supposed to recieve it, or you do the matching inside the Multicast RPC once it has been recieved by the clients

#

there is no way to specifically send a multicast to certain connections

north kettle
#

mh right, i was afraid so. thanks for clearing it up

meager spade
#

if it has to go to certain PC's

#

do a Client RPC

#

as its on the server anyway, server can grab the player controllers of who it needs to send to, and just do a client rpc

north kettle
#

yeah that seems reasonable

worthy knot
#

@gleaming niche Rebooted my router and my pc, cant seem to connect

north kettle
#

i was also wondering whether i could use the custom_condition to selectively replicate relevant information to clients thats relevant to them

#

from what i understand from reading into it, it might just work, but i didnt get to try it

gleaming niche
#

Your pc, and the server are plugged into the same router arent they

worthy knot
#

No they arent

gleaming niche
#

And you modified the router rhe server is on, like i said in the firdt place?

worthy knot
#

No i havent touched the 192.168.1.1 of the windows server machine

gleaming niche
#

......

worthy knot
#

i did, it said failed to connect, thats why

#

but i will try it now

#

again

gleaming niche
#

Google "how does networking work"

#

Or something

#

Youre trying to connect to a server on a different network via public ip, right?

worthy knot
#

Im accessing this machine through VPN and remote desktop

gleaming niche
#

If you are, its the OTHER server that needs ports forwarded!

#

So that a public internet connection can go through ITS network

#

On a specific port

#

And reach the server

#

Modifying your own router

worthy knot
#

yeah i am trying to connect to the public ip of the server machine where my game is running right now

gleaming niche
#

Is only for if you want OTHER PEOPLe to CONNECT TO YOU by YOUR public ip

#

If you didnt setup the server yourself

#

Then you need to ask the provider

#

To map ports for ypu

#

If you have a dedicated public ip

#

If you do not jave a dedicated ip on that procider

#

You cannot do this.

meager spade
#

i mean you can use a dynamic IP with something like DynDNS or w/e

trim gale
#

Trying to build a Client Authoritative MP game, with a lot of collisions (think, Rocket League). Any advice on how to actually go about sending client inputs to the server and simulating physics on it based on those inputs?

meager spade
#

good luck is all i can say

#

there are some readups on YouTube about Rocket League

gleaming niche
#

The problem is the public ip doesnt connect down through the nat to the server he is running.

#

It doesnt route.

#

He can connect over vpn (lan ip)

#

But not public

#

Because the public ip doesn't know how to reach his server machine lol

meager spade
#

i dunno, i just set my firewall settings, on my server, and boom it works ๐Ÿคท

winged badger
#

thats because the router doesn't expect an incoming package from the client so it ignores it

meager spade
#

then again i know what im doing lol

gleaming niche
#

Exactly

worthy knot
#

All multiplayer games connect via public IP right? games like csgo that have dedicated servers

gleaming niche
#

Ive explained this 5 times

meager spade
#

ofc how would they connect?

gleaming niche
#

Csgo also supporrs steam networking

#

So it will nat punch automatically

meager spade
#

all dedicated servers will have an external public ip though

winged badger
#

as do steam matchmaking servers

#

then they make an introduction for you

gleaming niche
#

Indeed, but with the steam implementation in ue

#

You still need to open the querry port for ds.

#

Even when using sessions/lobbies

#

Ier 27015 +

worthy knot
#

damn

gleaming niche
#

(Defauly half life 1 port)

#

Default

winged badger
#

all you need to get through the NAT is dedi to send a packet to clients ip/port before the client can connect really

gleaming niche
#

And hl2/source. Has just stuck.

winged badger
#

and UE implementation for dedis doesn't do that?

gleaming niche
#

I wanna go back to valve and forget everything.

meager spade
#

i thought Nat punchthrough only mattered for Listen Servers

#

or p2p

gleaming niche
#

Yeah

winged badger
#

it matters only if the server is behind NAT

gleaming niche
#

Or with a lobby

winged badger
#

doesn't matter what kind of server

gleaming niche
#

Ibwas saying csgo supports it

#

Because it can make an actual lobby.

meager spade
#

server should have a dedicated external IP though

gleaming niche
#

So even if its a DS it can do steam sockets.

winged badger
#

dedis tend to have a public IP, so they don't usually need it

meager spade
#

where no punchthrough is needed

gleaming niche
#

L4d is only steam sockets for examplew

#

Whether you have a ds or not.

#

L4d/l4d2

meager spade
#

hmm

gleaming niche
#

It uses the steam lobbies which were originally "matchframework"

meager spade
#

btw @winged badger i found some more interesting fails in the nav system in UE4

gleaming niche
#

In the original source engine implememtation

winged badger
#

i am shocked

meager spade
#

not as spectacular as the one we both saw lol

winged badger
#

that entire system is held by ducttape and prayer

gleaming niche
#

And then it was moved into steam itself in i think 2009. After i left valve.

#

And then made availavle to steam partners

meager spade
#

@gleaming niche they put 2 defines for the same thing in 2 different places, and only one is configurable, the configurable one only works with default nav filter, any custom nav filters, uses the non configurable one...

gleaming niche
#

You meant to tag zlo, but i dont mind

meager spade
#

the fail here is, WHY is there two defines for the same thing..

winged badger
#

oh i know about it

meager spade
#

nah was just explaining the fail ๐Ÿ˜„

#

incase you didn't understand what i was talking about

gleaming niche
#

I qas just talking about the steam ladies not nav system :)

#

Lobbies**

meager spade
#

was trying to take your mind away from it.. ๐Ÿ˜„

gleaming niche
#

Lol

meager spade
#

think the other person got scared off

winged badger
#

and to be fair, you did start mixing ladies and lobbies ๐Ÿ˜„

gleaming niche
#

Ladies can be mixed with anythinf.

limber gyro
#

yo guys, i need to get info about my players from an external sdk that is already implemented into unreal, what is the best place to call that sdk function to get that info before any player joins? beginPlay()?

winged badger
#

def not

#

you shouldn't even allow BeginPlay to be called before that's already received

limber gyro
#

ladies are good mixed with other ladies

#

ok so where should i call it?

winged badger
#

whats the scenario?

limber gyro
#

i was trying to find a list of functions in order but i cant find anything

#

i got my servers in playfab

winged badger
#

don't care about that... whats player doing? connecting for the first time?

limber gyro
#

and they host session there and pass the list of player to their sdk

#

i want this before players even connect

winged badger
#

there was a hook for that somewhere

#

its mostly used to check for and download updates

#

but can server for this purpose as well

gleaming niche
#

You want to read on server?

winged badger
#

might had been PreLogin

gleaming niche
#

Or client?

limber gyro
#

server

#

prelogin is only called when a player joins no?

gleaming niche
#

Then somewhere in prelogin/login/postlogin

winged badger
#

no

meager spade
#

well its the first step

gleaming niche
#

Prelogin calls when they ask to join

winged badger
#

Login is called when they join

meager spade
#

prelogin is like a permission

gleaming niche
#

It sends the challenge packet

limber gyro
#

well i dont want that either then

gleaming niche
#

Well then youre kinda ducked

#

Sonce server wont know they exist

#

Until prelogin

limber gyro
#

because this needs to be called before any 1 is even asking to join

gleaming niche
#

So how can it look then up?

limber gyro
#

the info is already there in the sdk

#

i just need to call the function

meager spade
#

if it needs to call before anyone joins, then once the server is hosted and the map is loaded, just run that function ๐Ÿคท

limber gyro
#

yes exactly but is there a place for that?

gleaming niche
#

So server automatically knows someone is connecting, without the client telling them "i wanna vonnect"?

winged badger
#

you mean the function to retrieve the info is in the SKD?

limber gyro
#

yes

#

and i want to call it somewhere before some one joins

winged badger
#

and that function doesn't return immediately

limber gyro
#

it should

winged badger
#

only if all the data is on that server

limber gyro
#

at least from what i gathered fro mthe documentation

gleaming niche
#

What sdk is this

limber gyro
#

playfab

gleaming niche
#

So playfab knows a user is going yo connect before they try to?

limber gyro
#

u spin up a server on their end and when it spins they send a list of al lplayers to the sdk

#

yes

gleaming niche
#

And it can predict the future, for unreal to preload?

limber gyro
#

because its matchamking

#

you make a ticket with a list of player and they spin a server for those players

gleaming niche
#

Then shouldn't you be Ble to hook in the place where it.. notifies?

#

Ive never used playfab so. Im just guessinh herem

limber gyro
#

well it doesnt notify anywhere, you just call GetInitialPlayers()

#

its not like a callback

winged badger
#

if a matchmaking Ticket spinned the server up

gleaming niche
#

Ahhh

winged badger
#

that data is available

gleaming niche
#

So you wanna know after the server loads

#

So like OnMapLoadConplete

#

Or something

limber gyro
#

ye

#

something like that

gleaming niche
#

Well search that

limber gyro
#

i want to know if a function like that exists

gleaming niche
#

Exceptnwithout tge typo

#

Becauae i just named a function

winged badger
#

if the playfab initializes early enough

gleaming niche
#

That is called after map loads

#

And just make sure its not /fame/entry or whatever

limber gyro
#

i want to know if any of you know what the best place to call such a function is

gleaming niche
#

I need to change this damn keyboard. My typos are attrocious

#

I just told you. If you can get past my typos lol

winged badger
#

i don't know when does prefab get initialized

#

but map load shouldn't have anything to do with it

limber gyro
#

it should initialize before anything

rich ridge
#

u spin up a server on their end and when it spins they send a list of al lplayers to the sdk
@limber gyro how playfab can know the list of players while you it is spinning the server

winged badger
#

as server should be aware of the data at the startup

#

then try a GI subsystem

limber gyro
#

@rich ridge because they spin it based on a matchmaking ticket

gleaming niche
#

He just wants to know when to call it after the server has loafed and is rrady for players to connecg.

winged badger
#

override its ShouldInitialize to check for dedicated server

rich ridge
#

Means players will have to wait 2-3 mins because server spinning will take take.

gleaming niche
#

Onpostloadmap or whatevrr it is, seems like at least a starting point.

#

The same place iirc the default implementation of a session would be

limber gyro
#

@winged badger i dont need to check for a server i just need to know the correct place to call fucntions before every one connects

gleaming niche
#

Whatever gamemode calls

limber gyro
#

im gonna check that @gleaming niche

winged badger
#

InitGameState

#

is fine

#

in GameMode then

#

its called right after GM is instantiated

#

and there is no connecting before that

limber gyro
#

ok great

rich ridge
#

Begin play???

limber gyro
#

thats actualy sounds like the correct place

gleaming niche
#

Yeah initgamestate probably males more sense for this.

#

Yeah screw this im changing back to the neural keyboatd beta

winged badger
#

you should probably now allow BeginPlay (ReadyToStartMatch to return true) before all the players on your list have connected or timed out, too @limber gyro

gleaming niche
#

Okay i think this is better. Less typos to be had, i hope!

winged badger
#

can switch to 2 fingers typing technique ๐Ÿ˜›

limber gyro
#

@winged badger why?

#

im not doing anything in begin play

winged badger
#

why would you start the match

#

if all players aren't ready yet?

limber gyro
#

im just doing it with a timer haha

gleaming niche
#

I am typing with two fingers.

#

Thumbs.

limber gyro
#

and a player counter, so when we have 6 players in a match it starts

winged badger
#

ah, mobile

#

im not any better with it

limber gyro
#

mobile?

#

dont you guys have phones?

rich ridge
#

@limber gyro why counter???

winged badger
#

and what happens if you had 6, one drops out before connecting?

gleaming niche
#

But default samsung keyboard sucks. So i switched back to the beta keyboard that is similar to crapples ios keyboard. Lol

limber gyro
#

@rich ridge count the amount of players in the server so it can start

gleaming niche
#

(In function)

rich ridge
#

You have Array of PlayerStates

#

If count is 6 start match

winged badger
#

you actually don't

#

@rich ridge

limber gyro
#

@winged badger thats a good question

rich ridge
#

Yes we have

winged badger
#

PlayerStates register with GameState on BeginPlay

limber gyro
#

i havent ironed out those details tbh, its my first time doing online multiplayer

winged badger
#

if you're checking for number of registered PlayerStates in GS to start a match (call BeginPlay on World)

rich ridge
#

After PostLogin, players are added into playsState array

winged badger
#

you have a chicken or the egg problem

gleaming niche
#

I just have a warmup period that waits either for all expected people to join and be ready, or timeout and start a "practice " round, unless they never come.

#

But, its an fps so its ok.

rich ridge
#

PlayerStates register with GameState on BeginPlay
@winged badger player state is created right in the Login call of GameMode

winged badger
#

yes

#

but its not added in PlayerArray until BeginPlay

gleaming niche
#

Created yes. But it doesnt register until startplay

rich ridge
#

Ohh

gleaming niche
#

Which calls beginplay

winged badger
#

as PlayerArray is not replicated, every instance of every PS on every machine registers on BeginPlay

#

you do have AGameMode::GetNumPlayers and GetNumTravellingPlayers for this

limber gyro
#

@winged badger dude how do you know so much about unreal?

winged badger
#

i do this for a living so i made it a point to read through the game framework code a couple of times

limber gyro
#

where do you work at?

winged badger
#

Ironward

limber gyro
#

UE4 code base is so big mustve been a daunting task no?

winged badger
#

i didn't read the entire engine

#

but i did get very familiar with the classes in GameFramework folder

limber gyro
#

you should definetly make a tutorial or 2 about that

#

function call order and stuff like that

#

theres nothing out there

meager spade
#

i know most of that flow now ๐Ÿ˜„

#

its quite essential TBH

chrome bay
#

Multiplayer can only be experienced ๐Ÿ˜„

meager spade
#

all i remember was Zlo swearing and cursing at the way UE4 GameMode is

worthy knot
#

btw thanks for the info @gleaming niche

meager spade
#

whilst he was making the custom GM

winged badger
#

we made a system that is able to procedurally spawn 30k Actors and have them networked and ready for 8 player match in 12 or so seconds

#

every tiny detail in order mattered

meager spade
#

and only once all clients have finished generating the level, does the game start

winged badger
#

as well as lying to the engine where appropriate

chrome bay
#

intrigued to see what you're working on ๐Ÿ˜„

winged badger
#

we even got accurate loading progress bars as a sideeffect ๐Ÿ˜„

meager spade
#

12 seconds* Hardware dependant ๐Ÿ˜„

winged badger
#

no shitty laptops were involved in 12 second benchmark

gleaming niche
#

only raspberry pi

meager spade
#

but during the Steam fest, average load times was around 22 seconds

#

which i think is quite acceptable

winged badger
#

we can still shave a few seconds there

worthy knot
#

@winged badger how do you lie to the engine lol

meager spade
#

oh we do a lot of lying

winged badger
#

it had to think that all the procedurally spawned actors were loaded from the package for this to work

meager spade
#

when it comes to networking

#

as in those actors existed on the level

#

not just spawned

#

so we don't dispatch any begin plays, we do some overrides to make them net name stable, only once everything is done, does BeginPlay get dispatched, and things start replicating

winged badger
#

But yeah, GameMode, 20 function overrides and only 2 Super calls here

#

its bad ๐Ÿ˜ฆ

peak sentinel
#

If Elon Musk's neurolink could* upload this channel to my brain I could work at Rockstar

limber gyro
#

i had to "lie" to the engine sorta, to get steam to work with dedicated servers

#

pass empty stuff into the overrides so that it doesnt crash

#

the deeper you go the bigger the lies become

rich ridge
#

@peak sentinel Surely pigs can get this uploaded this channel to their brain and work at RockStar before u

peak sentinel
#

that would be interesting

rich ridge
#

If that happens most of the people won't get pork to eat... By the way I don't eat pork

gleaming niche
#

Mm pork.

#

Makin bakin.

rich ridge
#

I have this question and couldn't find answer to this, this is not related to multiplayer but it's related to hosting server and cost.

My question is.
I m running my dedicated server on gamelift, and using some third party service which also happens to run on AWS.
So will I be charged for network urges between these 2 services

#

Amazon do states that within amazon cloud there are no charges , so I m confused the same is true between inter company products in aws

#

For example my gamelift and Epic Online services

limber gyro
#

not sure this is the right place to ask that kind of question

rich ridge
#

There are people here to happen to worked on mp games and have dealt with AWS, so must be knowing, that's y asked

livid holly
#

hi all, im working on a multiplayer pong and it all seems to be working good, however sometimes, the client sees that s/he hits the ball but then the ball just pushes it away and pass through, because in the server, the paddle wasn't quite in the same position yet

#

is this an intrinsic problem that will result from the authoritative nature or the server, or is there any way to alleviate it?

#

the paddles movement is client-side predicted and works fine, but the ball is completely simulated by the server

#

is it possible/desirable to have the ball's state in the client "ahead" of on the server?

uneven cliff
#

I'm having an issue accessing save games on local machines. I have an instance running as the host on one PC, and his selected character is green (pulling from his save game), then another instance running on a different PC with their selected character to be red, but when it enters the game, it pulls from the host's save game, and now both characters are green. I know this is probably an issue with replication or something, but I don't know what. Anyone have an idea?

fossil zinc
#

Hey guys, anyone knows how does root motion works for multiplayer? I have some animations with root motion that move all over the place in the client but look nice in the server. They way im doing this is that I'm playin a montage in the player character via a NetMulticast Function.

steel vault
#

I'm beginning to sense Zlo and const_cast work together... which is also why they seem to be the experts on everything ๐Ÿ˜…

#

Without those two in here I feel like we may be lost

fossil zinc
#

haha I think you're right

#

is it possible/desirable to have the ball's state in the client "ahead" of on the server?
@livid holly Im not really sure but this doesn't seem right. The player being ahead of the server could lead to some heavy gameplay losses. How are you handling the impact between the ball and the paddle?

livid holly
#

I spent the entire morning trying to make it work but there was always an issue

fossil zinc
#

There always are, its all good. Are the paddles like different pawns? How do you handle collisions with the ball?

livid holly
#

the paddles are pawns, im just using unreals physics

lucid vault
#

Don't forget Jambax

livid holly
#

what I need to avoid is simply, if the autonomous client hits the ball, it should hit the ball

#

i just had an epihany though. Currently, when the ball enters the goal in the server, the score is made and the next ball comes

#

but maybe I can make that, if autonomous proxy paddle hits the ball, it warns the server, and even if the ball in the server enters, the server reconstructs?

#

so it's trusting the client a little bit

fossil zinc
#

When the ball hits the paddle it should notify the server and he should figure out what to do. Trusting the Client is never a good Idea, since can be prone to cheating or network de-syncs.

#

What I would do is to notify the server once I found the collision so the server tells the ball to go the other way.

livid holly
#

yeah, but one of the requirements is that "when the player client hits the ball, it hits"

#

thats what I just thought of @fossil zinc , seems easier than what I tried to do in the morning

#

gonna try to implement it, thanks

fossil zinc
#

Np man, good luck.

livid holly
#

hmmm but then I cant just replicate the balls movement right? Otherwise, if the server goals before the paddle hits, the ball is going to tp behind the paddle, and then tp back to its gameplay position

fossil zinc
#

Well I think it depends on the way you're moving the ball. If you're using a Movement Component (Which would be ideal) you can add a force from the server the component would do the rest.

livid holly
#

im just using a static mesh and simulating physicis

fossil zinc
#

The physics engine should replicate too if you apply those in the server.

#

Haven't try it but the physics engine should be easier to replicate, since should be already implemented.

bitter oriole
#

Physics can't replicate

#

Not unless you just expect the server to tell you the newest physics state a full ping time after you move

#

And of course UE4 physics are not deterministic

livid holly
#

I mean im not replicating the entire physics, just the position / velocity using bReplicateMovement

bitter oriole
#

That's not really a thing

#

bReplicateMovement will teleport your object randomly behind your current location because your local movement will always be ahead

#

No interpolation either

#

bReplicateMovement only works for replicating the initial location of an unmovable object, ironically

livid holly
#

๐Ÿค”

bitter oriole
#

For actual movement you need a full blown rollback/replay movement component like CMC, or your own thing

livid holly
#

so instead I should replicate position and velocity and interpolate?

bitter oriole
#

Yes, and then rollback to the old stored state matching that server state's time, replay stored moves, apply some inevitable correction

livid holly
#

this in the client or in the server? In the client right?

bitter oriole
#

Client

#

Server will need to interpolate too to account for framerate differences

#

Remote clients will also interpolate

#

Owning client is the hardest part

livid holly
#

Ive done it for the players paddles, but it can be done because the autonomous client can store all the inputs

#

and then when the server sends back the state, it can rollback and reapply

#

but for a simulated proxy like the ball, there are no inputs

bitter oriole
#

There are, it's the hits applying forces to it

uneven cliff
#

When I call "LoadGameFromSlot" while in an online session, it always loads the saved game that exists on the server, even if the client is calling it. Is there any way to have the client get its own save game data from the local client?

strong vapor
#

[Question] Im using blueprints and sending an RPC to the client when they do damage to somethingg.. right now it's just an Int.. is an Int64 more bytes? regular blueprint Int's are only 32 right?

#

the damage amount can never go over 9999

#

so i think an int is my best bet.. unless its not?

sick totem
#

For dedicated hosting on aws gamelift, are there any tutorials on getting a blueprint project into aws without buying a plugin? I have a vr project where I want to host and get multiplayer into

steel vault
#

@strong vapor Int32 is an immutable value type that represents signed integers with values that range from negative 2,147,483,648 (which is represented by the Int32. MinValue constant) through positive 2,147,483,647 (which is represented by the Int32. MaxValue constant.

#

You will be able to go quite high, if you want something smaller you could go int16

strong vapor
#

there's no way to do int16 or int8 in blueprints though right?

#

i might bring it down to C++ later but right now im just tryin to get it togetehr

#

thank you for the answer!

steel vault
#

Np. You can try short I believe? That might work and it's 16 bit

#

But yea without C++ I think you need to just stick to int32

strong vapor
#

so.. lets say i spawn an actor on the server.. but its netdormancy is set to dormant all

#

does it still exist on the client when i spawn it on the server?

#

does anything happen on clients when it spawns?

strong vapor
#

[Help] So i'm noticing that just because i spawn an actor with a replicated variable that's also set to expose on spawn.... in the client's construction script.. that variable is not set to what it was set to in the SpawnActor function

#

i basically just wanna make sure my arrow's charge power is on the client the moment it spawns

#

cause i wanna set it dormant and let it just do its own thing to save on data

#

instead of having it replicate movement

#

mmmm i guess i could hold off on activating the projectile movement component until the charge power comes in on a rep notify

#

or i could just multicast spawn the actor with the variable.. just seems sloppy

#

seems like a repped variable should be repped on the moment of construction if its exposed on spawn

strong vapor
#

[Solution] it might not be there in the construction script but its there on Begin Play.. i just activate the ProjectileMovementComp there.. woot

odd iron
fossil zinc
#

Hello Guys Are there anyway to Sync the Fractures sometimes its not same xD
@odd iron I've never done anything like that but it seems hard to get the exact same behaviour in both machines, since aparently is a bit based on physics and thats a bit unpredictable. Again, I'm not sure so maybe someone with more experience can lend u a hand, but the idea is that you replicate instructions and things like this are reproduced in each machine.

odd iron
#

Yes its hard to Replicated Physics Stuff also I have Grab System same issue the Synchronization between the clients is different little bit

strong vapor
#

what part of it needs to be exactly the same for your game to work?

#

maybe some of it can be faked.. and some could be turned to actors with replicated movement somehow

#

is it the actual tumbling down that needs to be the same? cause that seems like it would be really hard

#

and a lot of stuff to replicate

strong vapor
#

[Help] Im trying to use the network profiler.. and in my capture i think it's telling me there's some RPC

#

RPC's that are huge

#

but how can i find out more about which ones and what scripts and stuff

#

i can click on the actors tab and get a read on all the replicated properties

#

but what about those RPCs

#

ah shti found it

#

bottom right, rpc filter

analog rover
#

Can I serialize a weak object pointer to a replicated component/actor into an FArchive, and send that across the network?

winged badger
#

that doesn't seem like something that would work

#

it would if actor was loaded from the package

#

but if it wasn't all you can serialize into FArchive is the Actor's name, and there is no quarantee those match for dynamic actors

#

and FArchive doesn't know how to write in the NetGUID instead

#

@analog rover

#

i am puzzled why would you even try something like that

analog rover
#

Eh, I'm doing stuff with GAS and they have to serialize everything in an FArchive before doing RPCs

#

Well, target data anyways

#
{
    Ar << Object;

    bOutSuccess = true;
    return true;
}```
#

Object is a TWeakObjectPtr<UObject>

#

Surprisingly, this works fine

#

I haven't tested it with dynamically spawned UObjects, in this case it's just a component I placed in the world

#

And I don't know if there's some additional processing of the FArchive that converts the references properly in GAS specifically, but it seems to be firing correctly so far

peak sentinel
#

isnt "SetControlRotation" replicated by default? why should I replicate this function?

#

Only ControllerRot is replicated variable there

#

and without function replication it only replicated to everyone unless the owner-client

mortal glacier
#

hi guy, i need help on multiplayer display name

#

any 1 can give me a help how i display it

pallid ember
#

why is it that when my client throws the ball, the server still shows him holding it??! also when I send a click input (throws ball) it will force the client to drop the ball??!

#

im going crazy with this

chrome bay
#

@analog rover the NetSerialize functions are called with a special FArchive type that serializes objects with the Package Map.

#

So it can be done, you just need a wrapper struct (or of course you can just send them directly)

subtle peak
chrome bay
#

Widgets can't have RPCs

#

The PlayerState would need the RPC's, and the widget would simply call those functions

#

Widgets/UI has no network functionality. It's entirely local.

fleet raven
#

sure would be nice if the blueprint compiler warned you when you try to put an rpc in an object that doesn't support networking

chrome bay
#

Yeah.. seems like something that would be so simple to do too

subtle peak
#

Thanks guys, that fixed my issue! ๐Ÿ˜„

winged badger
#

if someone was dedicated enough to do some unspeakable things, you could make widgets network

#

and im not sure there is a way for a BP compiler to tell if the object is supported for networking or not

mortal glacier
#

is any 1 have experience in set multiplayer display name ?

#

can teach me

twin juniper
#

Widgets encapsulate cosmetic things (which runs on the local machine). Cosmetic things (just the local representation on your machine) and real gameplay should be seperated.

#

My recommendation: recognize the structure of the engine, and build things that reinforce/compliment that idea.

#

It's not recommended for widgets to drive gameplay state. It's ideal for just presenting what is going on (as observer)

subtle peak
#

Does anyone have experience with VOIP? How does one set that up?

peak sentinel
lucid vault
#

Net pktlag is not round trip ping, right?

wild frost
#

I'm having trouble using the joinsession and hostsession blueprint nodes. Connecting to games on my own machine works fine but I can't manage to connect to any games not on my own computer. What could I be doing wrong?

pallid ember
heady python
#

@pallid ember can you show your BP's

pallid ember
#

when client throws ball, it is not shown in server. also, the server by mouse click can cause the client to release the ball. strange behavior!

meager spade
#

eww

#

why you using GetAllActorsOfClass

#

so how does the server know when you have thrown it?

#

your release just grabs the ball locally

#

and turns its physics on

#

how does the server know that?

#

and why are you not storing the held ball?

#

you KNOW you have the ball, why not just store a reference to it

pallid ember
#

what should I be using instead of GetallActorsOfClass to reference actors in another actor?

#

it fires the release event before adding impulse

#

what do you mean store the held ball or reference of it? the ball attaches itself to the player's socket

#

@meager spade all very good points. but the "release" blueprint is supposedto be replicated on teh server

meager spade
#

release blueprint?

#

how does the server know to run it?

pallid ember
meager spade
#

but..

#

that is on the client?

#

Multicast can NOT be called by a client.

pallid ember
#

but it says replicate?

#

I tried it with other options

meager spade
#

Run on Server

#

is what you want

pallid ember
#

@meager spade I've tried that same result

meager spade
#

then the server has to run the multicast

pallid ember
#

I tried that too

meager spade
#

๐Ÿคท

#

but what you have there is wrong

#

Client can't call Multicasts

#

also you need to add impulse, etc on the server

#

there is more to do that what you are doing to make that ball fly on client

pallid ember
#

so I need to clone the add impulse for the server and the client?

meager spade
#

either make a function that is Run on Server

#

and call that, which does all that logic

#

including a multicast

pallid ember
#

okay perhaps I need to wrap up the whole throw logic in a custom server event, and after calling that event , run the rest on the client

meager spade
#

yes

pallid ember
#

@meager spade also you said get allactors of class is bad...what should I be using instead

meager spade
#

storing a reference to the ball

#

when the ball overlaps a player, you have the ball right there

#

just store it as reference

pallid ember
#

okay but the overlap event is in the ball actor

#

it attaches itself to whoever it runs into

#

I assume you mean the actor variable in the player blueprint

pallid ember
#

oh I see what you mean now. I was confused because the ball was being attached to the socket. you meant the reference to it should be stored in the actor who has the ball so I don't call getallactorsofclass fucntion

pallid ember
#

haha! now it drops the ball that did it

#

just feels weird duplicating code

vale ermine
#

So today I am working on my gamespark database and I have a question about best practice. My Idea for best practice would be. On server start up - Catch all database information to the server. (That way we can make changes on the server and prevent asking the database for that information all the time). From what I understand is that each call to the database creates an object. I can either catch that on the first time it is called or have it already cached on server start up. The benefit I see to catching when used would be that you would only catch player data of current active users for that week until maintenance. Were this would clear the catch and objects from the server.

peak sentinel
#

is Epic Games Online Services allow us to be Listen Server in Android/iOs?

uneven cliff
glacial burrow
#

I have a switch authority node... if i only call it on the client, nothing happens. If both client and server are connected, both call it.
But why doesnt client on its own calls it ?

vale ermine
#

I just ran mine as client and it printed out the message it should for being a client.

glacial burrow
#

oh yeah it prints the right messages. But i have a function that only gets called when Server and Client call it, but never the client alone

vale ermine
#

well because the pawn is replicated so you will get only what the server does? So the pawn would have to be the server to work?

glacial burrow
#

argh fml

#

its an OnBegin which binds the UI events

#

this is all so confusing for me ๐Ÿ˜ฆ

vale ermine
#

well it should get better

#

see you make a custom event

#

then you set it to execute on either client or server through the custom events properties

#

then you can run that function you want from the custom event you set to run on client

glacial burrow
#

the point is, the object should never be replicted ... its an UI Helper which just handles the UI things

vale ermine
#

The player controller sets up your hud correct?

glacial burrow
#

yes and no

#

i have 2 seperate systems that each bring their own little hub

#

so i have a helper as a child actor that sets up the UI

#

the child component is not set to replicate and still the stuff of it gets called on the server ๐Ÿ˜ฆ

vale ermine
#

well yea so what im trying to say is that if you make a custom event and then set it to run on client it will run just like it was on the server so that is were you should create your widget so that you dont have to change it on the server to set the settings.

glacial burrow
#

yeah sure. I did understand what you said

#

And this is how i do all my stuff so far with the communication

#

but here, the object shouldnt be replicated and still gets replicated

vale ermine
#

I am not sure but I think its because the pawn is being replicated so everything attached to it is also.

glacial burrow
#

hrm thats quite possible

#

but i also saw that my other component gets replicated i tought wasnt

#

so ... there is that

#

i think im so close to understanding what im doing wrong with my system but i am also so close to giving up. Learning a new Engine and Network stuff at the same time maybe was a bit much for one person alone

jade patrol
#

what actor is this? who is spawning it?

glacial burrow
#

this is a childactor on my main character pawn

jade patrol
#

if the client spawns the actor the client 'has authority' and there is no remote as far as I know

#

the server must spawn actors that you want to replicate

glacial burrow
#

the server should spawn them ... i think.

#

you seem to be correct

#

that changes everything

#

my brain is melting so hard ... i wonder how people manage to keep up with all that all day long

jade patrol
#

it's a bit hard at first but once you understand the concepts and the framework behind it gets easier to detect this kind of small issues

glacial burrow
#

yeah trying to build a casting system right now ... where the server checks if the cooldown is ready and the resources are around and then informs the client that everything is okay so the client starts casting and then informs the Widget to show the cast bar

#

it shouldnt be such a hard system but damn am i having a hard time with it right now

#

working on it for 3 days now

#

atleast i got a big overhead removed with your help @jade patrol thanks for that!

jade patrol
#

glad i could help

glacial burrow
#

now i just need to figure out why my event on the server gets called but the client never gets it

#

then i should be able to cast my first spell (big moment^^)

jade patrol
#

if you receive the event on server you can call then another event for client only

glacial burrow
#

yeah that was the plan

#

so my server, at the end of the check has a EventDispatcher that gets replicated "ServerCastOk" this dispatcher gets triggered but only on the server

#

if i knew why, my problem would be solved

#

i guess event dispatchers just dont work over network as i imagined they should ?

jade patrol
#

no i dont think they replicate like that

subtle peak
#

Hey who owns the player state?

#

Each player?

glacial burrow
#

oof ... joe i would recommend the document of exi about networking ... that thing answers your question

#

i would answer it but i forgot the correct answer

#

okay ... great ... my client now gets informed about the event of the server

#

but my ObjectReference is null ๐Ÿ˜ฆ

#

so i guess i cant send references between server and client ? but this has to work ...

jade patrol
#

@subtle peak game state is replicated, it contains the array PlayerArray of players state, so everybody has that

#

you cannot share references ๐Ÿ™‚ you must replicate the data

glacial burrow
#

how do i replicate data if its a simple data class ? ๐Ÿ˜ฑ

jade patrol
#

you need to store the reference locally and update the data,for ex, player controller hold ui widget and you want to update ui widget of player x, you just say you want to update ui from player x ... not sure how clear i was, but the reference should exists locally

glacial burrow
#

so to say it more simple. My server does all the stuff, then says the client "Hey dude, we need a Data class of this type, i generated mine with these presets, make yours yourself, you need it later" ?

jade patrol
#

kind of yeah

glacial burrow
#

my brain is melting out of my ears right now ๐Ÿ˜„ but ... as exhausting and frustrating as it is ... it kinda makes fun

jade patrol
#

but what is the class?

subtle peak
#

@jade patrol What do I use to get the owning player pawn inside the Player State then? I guess I can't use "get player character 0"?

glacial burrow
#

just a simple description of a spell. Cooldown, resource costs, casting time

#

so it should be the same for client and server anyways ... but later on i want to generate this data out of a database on the server and send it to the client

jade patrol
#

that is a struct right? @glacial burrow

#

you can replicate that

glacial burrow
#

fml i can ?

#

hm wait

#

give me 2

#

okay ... @jade patrol so i have a class that has the struct in it

#

i guess thats the only way to gurantee i can have multiple spells ?

#

so when i say the variable on the class is getting replicated, does the whole object holding that ref gets replicated? that would be sickl

#

oh wait i could just send the class reference and not the object reference

#

since the class should have all that is needed for the client ๐Ÿค”

jade patrol
#

@subtle peak i think there is GetPawn function there that gets the controlled pawn of that player state

#

@glacial burrow so, if the object is replicated and the variable of the object is set to replicate it should be fine i think, but if the struct contains references it wont replicate those, references are only locally

glacial burrow
#

okay i think this is the big problem in my thinking

#

i worked for 3 years professionally in another engine on exclusive single player games. So network understanding is a bit difficult. But ... thinking about it, its totally clear that i cant send references between client and server ...

#

i got figured it out by sending only the class ref and not the object of the class. The client never needs to know what the server is doing with the object, like counting the cooldown ... its enjough when the client gets a value with "count down 15 seconds" and does so and gets an update from the server all 5 seconds about the cooldown so they dont get out of sync

jade patrol
#

i think in your case is a bit overhead to sync the seconds on cd. Usually you do that on client and on server at same time. So Client:Player cast spell, start cd -Server: VerifyCd (no: do nothing) (yes: cast spell, start cd)

glacial burrow
#

oh yeah thats also a good idea to handle it

#

the syncing thing more was a safety net i would build "later" if i run into problems

#

BUT: Good news! My Castbar on the client now shows the little icon of the fireball. This means that the whole communication chain works!

jade patrol
#

gj

glacial burrow
#

Thank you so much andrei for just giving me the few "hints" to think about my problem! โค๏ธ

grizzled quartz
#

How would one obtain servers(dedicated) IP on postlogin/join?

glacial burrow
#

uhm ... when exactly do you want the dedicated ip tsauken ?

grizzled quartz
#

onpostlogin

glacial burrow
#

oh, for that i have no idea, sorry ๐Ÿ˜ฆ

grizzled quartz
#

it shouldnt matter though

#

if its on join or later in game

jade patrol
#

usually you have a service for that that returns registered dedicated servers that are running in your area

grizzled quartz
#

i dont need that for server browser

jade patrol
#

if you look at online subsystems they usually implement servers and lobbies

grizzled quartz
#

they dont have that feature

#

im using steamadvancedsession

#

and that plugin doesnt have anything IP related, atleast nothing that is exposed

#

i just need to retrieve the IP that the client is playing at

jade patrol
#

steam should have the sessions of dedicated servers ...

grizzled quartz
#

i can get the session sure, but that doesnt help

jade patrol
#

oh i see, you want the ip ...

grizzled quartz
#

yup, i need to use the same IP for something else (connecting to VOIP server)

jade patrol
#

maybe when you register the session you also add the ip manually there?

#

as a param

#

and then when you get the sessions you read the param

#

just an idea, sure there is a better way

grizzled quartz
#

but thats the same issue, how do i retrieve the IP so it could be added as a param

jade patrol
#

GetIpAddress node?

grizzled quartz
#

does that even exist?

jade patrol
#

it does in docs ๐Ÿ˜„

#

but it's strange that is under audio

#

so it might not

grizzled quartz
#

yeah i see in docs as well, but dont see that in the editor

#

only example i found on the net

#

but cant really do that with PC, might try adding that with actor comp and see if it works

jade patrol
grizzled quartz
#

i tried that too, its pretty outdated

#

couldnt manage to compile it, too many errors

jade patrol
#

the only solution I know (which is bad) is to read an http request that gives you your public ip ๐Ÿ˜„

glacial burrow
#

If i have a pawn which belongs to a player and send an Event onto it which is replicated to owner. Why is the server calling it too ? ๐Ÿ˜ฆ

#

this is my last big problem for today to solve ๐Ÿ™‚

jade patrol
#

who is making the call to the event? the server? the client? both? is the event replicated?

#

you probably have a replicated event that calls that pawn event

glacial burrow
#

yeah ... :/

vale ermine
#

ok so I think I am going with catch player database to the server when a user request an item from the database. That way the only cached objects created on the server will be the objects of active players for that week because the server will reset during maintenance each week. Now on structuring the cache system I am not sure about. I would think if I set up the cache system in alphabetical arrays I can use Item names to search the correct arrays within the cache system. The reason behind separating these into alphabetical arrays is so that arrays are small and the server will not need to search the whole cache each time it needs to check if a player has an item. It will be able to check the cache array that is based on the first letter of the item.

#

this should save MAU count for database costs correct?

unkempt tiger
#

I have aquestion that's been bothering me for a while now

fleet raven
#

yes

#

you can measure it to verify - just send an rpc back and forth and print the start/receive time

unkempt tiger
#

sweet, then the 'average' preset that essentially provides a variance between 240 and 120 ping is really not the average case lol, usually server pings are about 60 ms

#

yeah

fleet raven
#

120 ping seems normal

#

maybe even low

unkempt tiger
#

idk, a lot of online servers I play on, the pings are about 20-75 ms

fleet raven
#

the vast majority of indie games will not have regional servers - for player hosted games over the internet you can consider 120 the low average

unkempt tiger
#

i usually refrain from joining 100+ ping servers because those are unplayable

#

hmm, yeah

#

im just pleased is all

#

when taking up the challenge of networking programming I treated the internet as the shittiest platform I could imagine it as

#

but its really not the case, its actually very performant in the average case

#

and that really helps my sanity

analog rover
#

Wait, the outgoing + incoming latency in network emulation is equal to half the ping?

unkempt tiger
#

ping usually refers to a round trip time, so from the client to the server, and then from the server to the client

analog rover
#

Gotcha

#

That's actually good for me because I was worried that the "bad" preset was a much lower ping then I would see in practice

unkempt tiger
#

you cant really tell whats the true client->server time or vice versa, but a good guestimate is just half the ping

#

yeah, they should really change those presets' names lmao

lucid vault
#

@chrome bay Aren't you TheJamsh from the UE forums?

winged badger
#

shhh, hes incognito

pine cipher
#

how do i add a widget to a specific player viewport and not all

lost inlet
#

for local multiplayer? ie. split screen?

livid holly
#

I just had the weirdest bug where in my PIE, the property was replicating fine from the server local player (listen server) to the client's simulated proxy... but in the build (or even in the launch game standalone), it wasn't

#

I was using GetOwnerRole() == ROLE_SimulatedProxy and it just wasnt working

#

and all I did was changing to using the IsLocallyControlled() flag and now it works

#

๐Ÿค”

magic quest
#

Umm I have a problem when I change the skin of one character it changes the whole lobby, what do I have to do to fix it

livid holly
#

is there a way that I can display latency on screen?

#

like I can display fps?

timid moss
#

I am trying to understand FFastArraySerilizer and found this in the comments```-You MUST call MarkItemDirty on the FExampleArray when you change an item in the array. You pass in a reference to the item you dirtied.

  •        See FFastArraySerializer::MarkItemDirty().
    
  •    -You MUST call MarkArrayDirty on the FExampleArray if you remove something from the array.```It says what we need to do when modifying or removing an item but it doesn't say what to do if you add an item.
    
#

So my question is when we add an item to our FastArraySerilizer what function call do we need to call? MarkItemDirty() or MarkArrayDirty()?

winged badger
#

you mark array dirty after add/remove

#

and item dirty after change

#

@magic quest its not really a networking problem, you changed the material on mesh asset instead of instance of the mesh

#

@livid holly PlayerState has a ping variable, for displaying it on screen for players its good enough

livid holly
#

tx

livid holly
#

when I play 2 instances of the game in launch games, sometimes the client drops for apparently no reason, OnNetworkFailure returns the error "connection to host lost"...

#

anyone has any ideas what might cause this instability? it's not any anti-cheat server validation

#

using netprofiler, I dont see any big traffic... outgoing bandwith 1.4 kbps is that too high?

#

(avg)

winged badger
#

read the logs, both server and client

livid holly
#

hmm once the client enters the map I get a lot of LogNet: VeryVerbose: GetFunctionCallspace indicating the RPCs... and then suddenly for no reason there is a
LogNet: UChannel::ReceivedSequencedBunch: Bunch.bClose == true. ChIndex == 0. Calling ConditionalCleanUp.

#

i was adding 2% pkt loss, maybe that has something to do with it? I didnt know packet loss could randomly disconnect a client

winged badger
#

and at the same time server logs?

timid moss
#

Does anyone know a good way to maintain order for items in FastArraySerelizer?

winged badger
#

put an index in the item

#

i rarely use fastarrays to replicate data without an object pointer, and when i do i rarely care about the order, index in the item handles the few cases where i do

oblique inlet
#

Hi, I'm trying to replicate firing a projectile from the default first person character and I've used:

UFUNCTION(Server, Reliable, WithValidation)
void OnFire();```
to make it work on the server, the problem is that the sound and animations no longer show up because all of it runs on the server. what should I change to fix this?
grizzled quartz
#

stupid question. does a dedicated server has its own controller?

#

because i am being convinced that it does, but i dont think so

winged badger
#

@oblique inlet do both

#

@grizzled quartz it does not

#

but listen server does

oblique inlet
#

didn't know you could pass both Server and Client, thank you

winged badger
#

you don't

#

you run what you need on client

#

and RPC what you need on server

oblique inlet
#

so call an RPC function inside the client function or bind 2 functions to the action?

winged badger
#

your Fire function executes local logic that you need + calls a server RPC

oblique inlet
#

so I call an other RPC function that calculates position rotation etc and spawns the actor and then play the sound inside the client function?

mortal glacier
#

is any 1 have experience in set multiplayer display name ?
can teach me

timid moss
#

Can you use the same FFastArraySerializerItem across multiple FFastArraySerializers?

zinc garden
#

In my project, players join as spectator. They get a widget, which submits a text. When that happens, I RPC to server inside player state to set a replicated "name" variable. Then I RPC to server inside player controller to spawn the default pawn for them. On BeginPlay for that pawn, it gets the player state and updates a textcomponent over their head to display the name that they had in their player state.

#

But inside the pawn, when I cast to the player state, I get a failed cast unless i add a delay after BeginPlay.

#

And 0.2s isn't enough, it has to be like 1s. So I'm wondering... isn't PlayerState created as a player joins the game? As in, when they join as spectator?

#

Here it seems like spawning the pawn is when the playerstate is spawned too

#

I wish that there was a "Everything is ready" event that you could use and know that there would be no failed casts due to things not being ready yet

winged badger
#

@zinc garden PlayerState has a much lower NetPriority compared to a Pawn

#

so it tends to replicate later

#

your pointer to it inside the Pawn replicated just fine, its just that the PS Actor itself didn't replicate yet

#

@timid moss yes you can

mortal glacier
#

i done save data to player state, and get data from player state,
my question is do we need to pass the player state to server?
when i trigger server to update all player data when have new user join

zinc garden
#

@winged badger Oh okay thanks.

winged badger
#

you can increase PS priority over 3, but keep in mind its not foolproof

#

it will break if there is packet loss, sooner or later

zinc garden
#

Yeah, I changed it to update the text OnRep of the name variable instead

keen thorn
#

Hi has anyone tried/looke into the newly available network prediction plugins?

#

it has extras for maps and example classes

#

seems to be a good complement to the overly complicated GAS system

zinc garden
#

@winged badger sorry but think you could answer another thing for me? When I fire the submit event from my clients widget, it gets the player controller, and rpcs to server to spawn the character. If I print string this, it seems it fires twice. Even if I have 3 clients. Any idea why?

winged badger
#

no i dont know whats connected to what, or if this is pie

#

or something else also prints

zinc garden
#

It's just a straight line client widget > text submit event > client playercontroller > printstring

#

But I guess if it doubles up that early, it shouldn't be anything to do with network

#

as it happens before I even call server on the PC

#

and yes, it's PIE

winged badger
#

put a breakpoint instead of printsrting

zinc garden
#

Ah true, I need to get in the habit of that

#

Hmm, it doesn't accurately show what all the clients get either. Get Game Mode ought to return null for a client right? if I mouse-over it, I do get a value even when viewing from a clients perspective

#

The breakpoint only fires once too... so weird.

winged badger
#

thats expected

peak sentinel
#

why its not working for me?

queen dagger
#

Hello guys! Iโ€™m looking for some consolation tbh lol

My friend and I had an idea for a fun simple multiplayer game and I knew about Gamelift and figured, โ€˜hey itโ€™d be easy!โ€™

Iโ€™ve looked into Gamelift and I realized it looks crazy complicated. I was looking at Flopperamโ€™s tutorial series

Iโ€™m wondering, if I do manage to get Gamelift working properly, is designing a user interface for a player lobby gonna be easy-ish (programming wise)? Is it easy to implement replication?

Iโ€™m worried it could turn into an unmanageable can of worms

tulip ferry
#

Hey guys! I'm dynamically spawning a bunch of replicated dynamic Static mesh Components on the server. And when I go to delete them, using the following code:

    {
        TArray<USceneComponent*> ChildStaticMeshes;
        BuildingProgress->GetChildrenComponents(true, ChildStaticMeshes);

        if (ChildStaticMeshes.Num() > 0)
        {
            for (int32 i = ChildStaticMeshes.Num() - 1; i > 0; i--)
            {
                ChildStaticMeshes[i]->DestroyComponent();
            }
        }
    }```

I end up getting the following warnings on the dedicated server: 
LogNetPackageMap: Warning: UPackageMapClient::InternalLoadObject: Received reference to pending kill object from client: PathName: NODE_AddStaticMeshComponent-4_3, ObjOuter: 

And the dynamic mesh is not cleared on the client. 
This code runs on the client, so I'm not sure what the warning means. 

Can someone help me understand what I could do?
cinder tartan
#
void AFloatingActor::GetLifetimeReplicatedProps(TArray <FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    //Replicate CubeActor
    DOREPLIFETIME(AFloatingActor, VisualMesh);
}
public:    
    // Sets default values for this actor's properties
    AFloatingActor();


    void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

what am i missing the object spawns but doesn't replicate to other clients

lucid vault
#

The reason I ask is because I have a question regarding the highlighted text. I'm trying to figure out how to do that

hollow bane
#

What strategies have any of you used for a multiplayer only game at launch (small user base etc)? This is 4-8 players and wonโ€™t have dedicated servers either, so bots isnโ€™t really a viable solution. This will be PC, Steam only.

bitter oriole
#

Well obviously never attempt a MP only title without a publisher's backing

#

And keep the player count at 3 max

#

Look at Disintegration, made by 20 experienced devs, published by Private Division, sold a few tens of thousand copies, and just announced they'll remove the MP mode because they have no one playing

#

That's 10x the average Steam launch

peak sentinel
#

@bitter oriole do you adsive the same thing* for mobile too?

#

of course you need support for every MP title, but should you never attempt it on mobile too?

bitter oriole
#

Mobile is probably much worse because a lot more games have 0 users at all, but I'm not familiar with mobile so take that with a grain of salt

peak sentinel
#

understood thanks

livid holly
#

do the packet simulation settings added do DefaultEngine.ini work in shipping builds?

proven forum
#

I need to do something to have the "Run dedicated software" option available?. Is not showing in my current project

zinc garden
#

I'm trying to connect with a buddy to try out my game. I've started a listen server (using commandline-argument MyMap?listen), but he's not able to connect using my public IP (again using that as a commandline-argument).

#

I've opened up port 7777 which some posts claimed to be the default port

#

Am I missing something else? Can't find much official documentation regarding this...

#

I could connect to my own server using my local ip, and he could do the same

winged badger
#

@zinc garden read the server logs

#

when it opens a map, there will be "listening on port XXXX" line there

twilit oak
#

is it standard to use the AOnlineBeaconHost / AOnlineBeaconClient classes for dedicated servers, where i guess the server would spawn the AOnlineBeaconHost and connect people trough that as a login. or are these just for player hosting? really hard to find any documentation on how to start making server code btw.. does anyone know any good tutorial / documentation that lists the classes commonly used etc..?

zinc garden
#

LogNet: GameNetDriver IpNetDriver_2147482568 IpNetDriver listening on port 7777

#

But I do get a yellow warning

#

[2020.09.20-19.44.49:346][ 0]LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)

proven forum
#

anyone know how can I get top down template working in multiplayer?

slim matrix
#

if i set my players inventory data on the server then how can the client save its inventory locally

river estuary
#

I got a very basic game project and trying to set multiplayer without doing much, but the character seems to sort of get stuck with him self, not really sure what's going.
Is that suppose to happen? is there a basic setup I need to do or something?