#multiplayer

1 messages Β· Page 702 of 1

twin juniper
#

You should not replicate your asset

#

Yup in fact

#

Tho I think they are always loaded when in editor

#

Might be wrong

ashen stone
#

i was trying to never load it on server, just replicate the "path"

twin juniper
#

Replication have nothing to do with that, it’s an asset, your clients has it anyway, replicate it is useless

fathom aspen
ashen stone
#

i need to change the visual when player equips new weapon or armor

twin juniper
#

Your asset has nothing to do with that again

#

SkeletalMesh = Asset
SkeletalMeshComponent = the one you want to replicate

fathom aspen
torpid mantle
#

sure

#

thx

#

so.. QQ on top of that

twin juniper
ashen stone
#

is it ok?

#

will it load the mesh on server?

torpid mantle
#

if the server never goes away 'async' gameplay, basic flow is login/auth, find game, load gamemode and state, do turn, end turn, resolve if still connected?

twin juniper
ashen stone
#

yes, on server

twin juniper
#

then just don't run it on the server 😐

torpid mantle
#

Also. How do I designate a cpp file is server or client?

ashen stone
#

This game is online, i need to make everyone see the equipments on their screen

#

if i do it on client, only the local client will see it

ashen stone
#

This is an mmorpg, when player equips "leather helmet" everyone needs to see it on his head

torpid mantle
#

just broadcast it?

twin juniper
#

yeah then again, just run this code

#

on clients

#

i don't see what's wrong

#

i'm literally doing it for my pickups

ashen stone
#

How do u do it

twin juniper
ashen stone
#

?

#

Is your game online?

fathom aspen
twin juniper
torpid mantle
ashen stone
#

On rep of what?

twin juniper
#

of my ItemEntry

ashen stone
#

Humm

twin juniper
#

The on_rep get called when i set it there on the server

#

i'm creating the components at runtime cause my pickups can have either skeletal or static mesh, you might maybe want to do that but slightly different in your case

#

the server does not need to know about the mesh since it's just cosmetic in this case

ashen stone
#

Ty

twin juniper
late vale
#

Is it possible to use my own Authentication System using MySQL and then use EOS for P2P Matchmaking?

untold summit
#

Hello, im trying to make a listen server multiplayer game where i need to make the pawn look at the mouse cursor, for that i use convert mouse location to world space, but i need to use get player controller, it works fine in the client event but in the server event gets the server player controller so all the pawns end looking at the server mouse cursor instead of their own mouse cursor

dusky yoke
#

Hey guys, been looking into how to make my player's respawn after being killed. So far I've found a couple tutorials & articles, but they just cover respawning on their death location. I want the players to respawn at their Networked Player Start locations. I'm guessing there should be a way to find these Networked Player Start actors and feeding their transform into the spawn of a player, but I'm not sure how. Could anyone shed some light on this? πŸ™‚

late vale
fathom aspen
untold summit
#

This is the code that executes in the server from my pawn

fathom aspen
#

It's because Location is replicated. Make it not replicated

#

You shouldn't be replicating this. Other players will end up seeing where the server player is looking because movement/rotation is replicated.

twin juniper
#

he shouldn't even use this node on server

fathom aspen
#

It's ok

hollow eagle
#

ehhhhhhh
it's not great practice. There's nothing about the API that guarantees that to be the case.

dusky yoke
#

Hey guys, anyone able to help me out with a HUD issue related to replication? Working on respawning, and the respawned player spawns without his HUD. Got 4 screens of the code, but dont wanna flood this chat, so maybe DM unless you guys are fine with it? πŸ™‚

fathom aspen
#

But in his case, it's not the cause of the problem

hollow eagle
#

Fair enough. Discouraging the use of GetPlayerController and related functions is just something I have to do πŸ˜›

fathom aspen
#

Haha, 100% agreed

dusky yoke
#

Lol, I'm actually using GetPlayerController for my code, and I think that's whats causing the issue, although Im not sure as its not working on the server either. Whats an alternative to GetPlayerController?

fathom aspen
#

GetOwningController probably in case you're in the player pawn class

#

Let me check

dusky yoke
#

I'm in a HUD πŸ™‚

fathom aspen
#

This is your lucky day

twin juniper
#

You can just use GetController in a pawn class

fathom aspen
#

Yep that's the one

twin juniper
#

that returns you a AController who's getting set when the pawn is possessed

dusky yoke
#

Oh wait, crap, Im not in a HUD, but a User Widget

#

My bad

twin juniper
#

you can even use the templated one i think πŸ€” pretty sure there is one

twin juniper
dusky yoke
#

The target for that is a HUD though

dusky yoke
#

Oh thank you, will test it out!

twin juniper
dusky yoke
#

Thanks guys! I guess that wasn't the problem for my HUD not refreshing on my respawned players. I'll sleep on it! πŸ˜…

hollow eagle
#

In 90% of cases where you need to know the player controller for something, there's a direct way to access it other than GetPlayerController. And the other 10% is something you can engineer around without using it too.
So don't use GetPlayerController (at least for multiplayer) πŸ˜›

fathom aspen
#

It's even templated

twin juniper
fathom aspen
untold summit
#

I tried my best but it didn't worked, maybe the GetPlayerController is the error but i cant find any solution to it

twin juniper
#

it wasn't at the time i made this :p

#

or i just wanted some clear functions for my code

fathom aspen
twin juniper
#

don't rly remember lol

twin juniper
#

so yeah that's why i made this func

fathom aspen
twin juniper
#

even did the same with TryGetPawn

#

i could just do a cast from TryGetPawn for sure but i prefer like this, it's more directly readable for people working with me and it's not a biiig function so not a prob

fathom aspen
#

Well one bad thing about this approach is that you might always use this function do unneeded casts, that will make you load unneeded data at runtime which can affect performance.
Sometimes all you care about is AController or APlayerController.

twin juniper
#

that's.. the purpose of it

fathom aspen
#

Well then that's something else. But other devs might be using it without them noticing...

twin juniper
fathom aspen
#

What do you think about this practice @hollow eagle

hollow eagle
#

which practice

#

TryGetXXXPawn?

twin juniper
#

approve me πŸ™

hollow eagle
#

I see no problem with it lol

#

casts aren't that slow

twin juniper
hollow eagle
#

and you don't have to use it in situations you don't need it

fathom aspen
#

Using a function that already does the cast for you, instead of using the engine one

hollow eagle
#

In cases where a templated method already exists I'd use that

#

but that's because you're just duplicating effort otherwise

fathom aspen
#

But isn't that extra work to implement a new function that has the same implementation in engine already?

twin juniper
hollow eagle
#

Not all engine methods have a templated method for cases like this

fathom aspen
#

Well ok this one doesn't

hollow eagle
#

Most do... in cases where you can do GetPawn<AZircoPawn>() I'd just use that but there's still no downside to implementing another method anyway

fathom aspen
twin juniper
fathom aspen
hollow eagle
#

I hadn't really read up on the context, just talking in general.

twin juniper
#

still don't get the problem

#

I just don't have the choice lol πŸ˜„

fathom aspen
#

I wasn't talking BP wise, but ok I get your point

twin juniper
#

I don't use this function on cpp, my widget classes are just mostly delegates

#

except some extra things that i do fully in C++ to avoid perf issues

finite pendant
#

I am currently working on a game and when I host a server everything works fine (ragdoll, shooting, respawning, dashing etc) however on the client that joins the server It can only shoot once on either gun then it doesnt work any more. As far as I can see it replicates on both the server and client but It just wont let the person that joins shoot after the first bullet. Any fixes?

Also on respawn it always another shot to be fired but only one shot

fathom aspen
#

No one here would figure out the fix if they don't see code

#

Show the code that does the shooting

finite pendant
#

My bad let me know if this is will suffice

fathom aspen
#

They are getting called on the client, because that's where input fires

#

Make them Server RPCs

finite pendant
#

so this?

fathom aspen
#

Yes

fading birch
#

IsCooldownActive isn't replicated

fathom aspen
#

What's Client on Weapon Fire functions? (Show them)

finite pendant
#

wow- i cant believe i missed that but thank you for pointing these things out

fathom aspen
#

I don't see what's happening to the right...

finite pendant
fathom aspen
#

Also is the code working by now?

finite pendant
#

yup everything is working now as intended

#

thank you so muchhhhh

twilit hearth
#

Hello, When using Command node for Server Travel ex:

fathom aspen
twilit hearth
fathom aspen
pallid mesa
#

Someone? πŸ˜„

#

My temporary solution consists on simulating for some time... but it's not very elegant per se.

real ridge
chrome bay
#

yep, that'd be the way

#

Done it a few times now for subsystem-based managers that need network functionality, just replicate a "State" actor for that system

kindred widget
#

inb4 UE 5.6 Replicated Subsystems.

molten vine
#

Excuse me... I've been looking around for server hosting. Does anyone know any server hosters that have support for ue4?

limber gyro
#

playfab has a custom plugin

#

ops

#

wrong quote

molten vine
#

I'm not able to use Steam for some technical reasons.

hollow eagle
#

steam doesn't host servers for you anyway

limber gyro
#

i think steam has limited server hosting capabilities no?

molten vine
#

No, but it provides functions for a lot of different multiplayer requirements.

hollow eagle
molten vine
#

Such as matchmaking and log-in and leaderboards.

hollow eagle
#

the general features they support do not include server hosting, just relays/lobbies/matchmaking/etc

#

anyway, playfab and gamelift are the big "managed" services

molten vine
#

So, playfab does actually host servers?

limber gyro
#

playfab does

hollow eagle
#

yes

dark edge
#

If you have to ask the question, don't make a dedicated server game IMO.

limber gyro
#

but for the login part ur probably gonna need to use steam aswell because their services are stateless forthe time being so they would allow 2 players to be logged in at the same time in the same account

hollow eagle
#

you can use literally anything you want for accounts

quasi tide
#

Doesn't playfab cost a bunch after a certain point?

hollow eagle
#

playfab has integration with pretty much all major platforms, or you can roll your own

hollow eagle
limber gyro
quasi tide
#

I'm talkin' about ramping up like P4 does though πŸ˜…

eternal canyon
hollow eagle
#

playfab's server pricing is based on azure compute prices iirc. Gamelift is probably similar in that they're based on EC2 pricing.

molten vine
#

Hm. Because I was thinking of working with AWS. And I have a plugin I purchased a while back for that.

limber gyro
#

playfab u pay by the call after a certain point so ye its probably gonna get expensive if ur running a big thing

molten vine
#

But the documentation is horrendous. And there appears to be no party systems whatsoever.

limber gyro
#

i tried AWS, it was a hell

hollow eagle
#

gamelift is built on AWS. But it's not the same API as using AWS yourself.

#

If you're directly using AWS or azure it's very different than something like playfab or gamelift

limber gyro
#

ur best bet is using steam with playfab

molten vine
#

I can't use steam is the problem.

limber gyro
#

u cant use anything?

molten vine
#

I'm building a game with fricking NFTs. Despicable, I know.

limber gyro
#

if u cant use anything ur better of just writing ur own backend i think

molten vine
#

But man, I have to pay rent.

late vale
#

I'm working with EOS and OpenID

#

Just let player's host their own servers

limber gyro
dark edge
#

Good luck on the surefire money making venture that is multiplayer gamedev.

molten vine
#

It's not surefire, that's for sure.

late vale
limber gyro
#

i think he was being sarcastic lol

molten vine
#

Openid?

late vale
#

Identity Provider on EOS

limber gyro
#

if u can get away with player hosting do it

#

just run the blockchain stuff separatedly

late vale
molten vine
#

And EOS bypasses port forwarding?

#

In a similar method to steam?

late vale
#

P2P Sockets would work

limber gyro
#

all hosting services that i saw have that setup already

#

u just use the ports that they tell u

molten vine
#

Yep, but EOS doesn't do hosting.

limber gyro
#

ur not gonna need portforwarding for logins

late vale
#

You can use Player Hosting with P2P Socket's

late vale
limber gyro
#

EOS is the same as steam i think although not as mature

dark edge
#

Your hosting and identity provider are not the same thing.

late vale
#

I'm totally unsure but I think Dedicated Server's do not utilize P2P

hollow eagle
#

Unreal doesn't support P2P period.

#

Listen servers are not P2P, before someone tries to say otherwise...

limber gyro
#

if u are 100% that u need a backend service go with playfab and write something for the logins so that u cant have multiple logins at the same time

lost inlet
#

the confusion is from listen servers using steam/eos p2p relays

#

well the ability for them to

molten vine
#

Welp. Maybe I'm better off trying to get a party system with AWS...

limber gyro
#

theres parties in playfab aswell but if rememeber correctly they are a bit early

hollow eagle
#

playfab already provides integration with most game identity platforms. There's no need to "write something for the logins" unless you specifically want to roll your own.

limber gyro
#

never tested them myself

molten vine
#

Is playfab compatible with AWS?

hollow eagle
#

playfab doesn't have anything to do with steam

late vale
hollow eagle
#

steam is just one identity platform it supports.

lost inlet
hollow eagle
#

transport level p2p has nothing to do with unreal's networking model.

#

as far as unreal is concerned you aren't p2p.

limber gyro
#

because hes working with nft's or something

lost inlet
#

yeah, all you're using eos p2p for is the NAT punchthrough, it's still client/server

late vale
#

Sooooo..... Still port-forwarding needed

lost inlet
#

what

limber gyro
lost inlet
#

I just said NAT punchthrough lmao

hollow eagle
limber gyro
#

i think they do the same thing give or take a feature

late vale
#

I'm now getting confused

hollow eagle
#

You do not manage servers manually with playfab or gamelift.

#

They allocate servers on top of azure or AWS as necessary.

#

playfab is built on azure, gamelift is built on aws

late vale
molten vine
#

Yep. Okay, so it's Playfab, which does have a team system, or AWS, which doesn't.

#

However...

lost inlet
# late vale I'm now getting confused

a client still hosts a listen server, it can use EOS P2P for transport which also allows for NAT punchthrough and it won't disclose the IP address of the user either

limber gyro
#

playfab's documentation was also a million times better the last time i checked

molten vine
#

What's kind of weird, is the fact that Playfab has almost no documentation though.

late vale
limber gyro
molten vine
#

Very little of that is actually targeted at ue4. And there's no tutorials on actually getting something like this up and running.

limber gyro
#

well, thats the best ur gonna get

lost inlet
#

because a lot of the concepts are game engine agnostic

dark edge
#

If you're wanting to paint by numbers throught a tutorial to make an NFT game then you're gonna have a bad time.

limber gyro
#

u can check the function names in c++ on the cosumentation and call them with the plugin

#

they have a free plugin in the marketplace

lost inlet
#

an No-Fucking-Thanks game?

#

I missed that context

molten vine
limber gyro
#

i have writen a small tut on the playfab forums on how to do matchmaking

#

so if u need that, that part is already done

#

it was a pain in the ass

molten vine
#

Dang, okay, thanks guys. I think I'm just going to tell this guy to fuck off, and I'm going to make single player games.

limber gyro
#

it is hard to do online stuff

late vale
#

^

molten vine
#

Eh not really. AWS only took a few days to get simple creating and joining matches. And Steam's a cake-walk. It's when you have to use poorly-documented less mainstream solutions.

#

That it actually gets bad.

dark edge
#

Just rip steam out and slap EOS in and you're off to the races. EOS is less mature but it works enough I think.

molten vine
#

Hmmm, but Epic Games EOS plugin sucks.

dark edge
#

Or roll your own ID, or go all in on blockchain stuff. Surely you don't need some other ID provider for a game with an in-place global settlement layer in it already.

molten vine
#

Barely functions in 4.27

lost inlet
#

cool you have engine source though

#

and the fixes are fairly trivial to apply

dark edge
#

Why can't my ID just be 0xb794f5ea0ba39494ce839613fffba74279579268

pallid mesa
#

Hang on, trying to understand what you wrote... so you mean that your subsystem will instance a replicated actor that holds a fast array serializer... what do you put in said fast array serializer?

sonic island
#

So I have a multiplayer project and the clients pawn is a defaultpawn (and the servers). The server can move and it replicates and the client sees it but the client cannot move.

twin juniper
#

well, show code ?

torpid mantle
#

Tank with potatoes now?

#

ha, you swap names so often

solar stirrup
#

Replication Graph question - I noticed InitConnectionGraphNodes() is called to create nodes per connection. Is there a function that's called to cleanup a connection?

unborn nimbus
#

Best cloud service for just hosting a small dedicated server?

plucky prawn
#

you could home host it for "free"

#

otherwise maybe AWS or something

#

theres also OVH or Vultr. dont go through/for a "game" server host but for general purpose VPS

#

an actual dedicated server will cost you a small fortune, like $300+/mo

unborn nimbus
#

Yea I was interested in which of the big 3 people had the most experience with

lost inlet
#

the cloud server providers are pretty much indistinguishable from each other anyway

#

well the reputable ones anyway

unborn nimbus
#

Agreed, I was mainly looking for "I tried AWS but I found GCP much easier to setup"

lost inlet
#

you'll probably get the same level of service/performance from AWS/GCP/Azure

#

since all you're really doing is spinning up a linux VM, and then you do with that what you want

plucky prawn
#

if i run enablecheats on the client through the console, does it actually RPC or does it just do nothing? its not saying anything in the server console that enablecheats was run, but when i try to run a cheat command, the server console says the command is not found

pallid mesa
#

so you have multiple fast array serializers? Or just one with stuff... like... I'm confused... and when it replicates u find a function mapping an ID and what do you do with it????

#

yes

#

ah so... the fast array serializer holds a struct with a primary key and a bunch of data?

#

so its indeed one fast array srlzr for object type, right? Unless this struct is somewhat generic and supports many different updatable objects

#

ye i know but u need to have the data

#

right?

#

not trying to get to any point

#

trying to understand it haha

#

so u have objects in your client that need to update certain properties, say u want to set a boolean to false in one of them

late vale
#

Just a general question. Port triggering is essentially port forwarding just only on when required

pallid mesa
#

yes but where does the updated bool come from? in this case

#

so this arrayserializer holds a struct with the updatable data

#

so if you have different object types u need different arrayserializers

#

right?

#

ahhh oki hahah

#

i understand it now :3

#

i was so confused

#

because i though u were Only storing IDs in the array serializer

#

and I was like: "well.. that's..."

#

πŸ˜„ ty for clarifying it

#

lmk how the implememtation goes cause I feel there'll be some gotchas

radiant jolt
#

is there any definite way I should set up a lobby system so anyone within a lobby joins a session when available?

radiant jolt
#

Actually to be more specific how would i differentiate lobby sessions vs game sessions

stark tree
#

Hi, is it possible to make multiplayer over different wifi connections using only Unreal Engine, or for that do I need a third party software?

stark tree
# radiant jolt It's very possible

Thanks. Is it possible if the players are using VR headsets? I want to make them be able to see each other in a VR environment. Trying to make a simple VR multiplayer where 4 people can see each other and move around in a room.

#

Very simple goal. 2-4 players each with their own VR headset, be able to exist in the same room and see each other.

radiant jolt
#

I've not done anything with vr but ive run by a bunch of documentation including it so I can't imagine its impossible

stark tree
radiant jolt
#

yeah exactly

#

iirc theres actually some vr specific multiplayer stuff too

stark tree
#

I can just make Unreal Multiplayer where upto 4 people connect to someone with their IP address or something.

radiant jolt
#

technically you can do that with a vpn but I just use the steam sdk

stark tree
radiant jolt
#

unreal doesnt natively connect over the internet

#

only lan

#

so you can either fake a lan by using a vpn, and make unreal think its a lan

stark tree
#

Oh, I see, That's what my original question was. So it DOES need some third party like Steam

radiant jolt
#

or you can use an online subystem

stark tree
#

Okay. Thank you. I am using Oculus Subsystem since my headgears are Oculus Quests. But it is far too complicated to get it to work. So I was think if native unreal connects over the internet

radiant jolt
#

I mean you dont NEED to use steam theres other subsystems, they can just be a bit difficult lol

#

If you dont wanna use a subsystem, id recommend looking into connecting through a vpn

stark tree
#

and if I was to use an Online Subsystem, which one is good? I think Steam only works on HTC Vive headsets or something.

#

Its a bit confusing.

radiant jolt
#

look into the null subsystem

#

its like a testing subsystem used for lan matches

#

but if you connect with your friends over vpn

#

you can connect to that ip address

stark tree
thin stratus
#

In the long run, what you are dealing with is Crossplatform Gaming

#

Where the EOS might help you

stark tree
thin stratus
#

Well, here is the thing

#

Do you need this to run between multiple platforms or not?

#

If you target only Oculus, then you should use the Oculus Subsystem

#

If that's too complicated for you to set up, then I have no real suggestion

stark tree
latent sky
#

Hi guys, does anyone know how to exchange inventory items between two clients (two players )?

chrome bay
#

depends entirely on your inventory system

latent sky
#

For now i just want to exchange an item in an array

chrome bay
#

Obviously the server would have to make the exchange, so whichever client wants to give the inventory away should be the one making the request

#

But the implementation details depends on your system

latent sky
#

Mmm thanks

bitter oriole
#

Depends if you're okay with people modifying their save data with notepad

stark tree
#

Anyone here experienced in VR multiplayer?

marble gazelle
#

Doesn't necessarily need to be a database. But as always it depends on the details^^ If you have multiple game servers you want a database / or a backend service that takes in the updates from the servers.
But if you just have one server for simplicity you could also just dump everything into files as start

stark tree
#

Im trying to do the exact same thing, need to do it over different Wifis. Did you have any luck?

short arrow
#

Just like clients, If the server runs an event that is not replicated it'll be reliable 100% of the time right?

bitter oriole
#

Reliable only has a meaning for replicated events

short arrow
#

Basically I mean I can definitely rely on it to fire the event

bitter oriole
#

Reliable mean "ensure received in order over the network" + "re-send if the network loses it"

#

If it doesn't go on the network it's a regular function

short arrow
#

And it'll be called 100% of the time right?

bitter oriole
#

Events are always called 100% of the time

#

If/how they arrive on a client is a network consideration

#

No network, no problem

short arrow
#

awesome, thanks

uncut schooner
#

Hey, how are you all doing?

#

I had a question about Pickups, Lets say there is 200 ms of latency,
and I am a client who interacts with a pickup, but lets say 50 ms later another client with 200 ms of latency also interacts with the
same pickup, How do I handle this, becuase if I run the script locally, lets say its a instant consumable, And it increases health locally first,
When the second client recives the thumbs down, should it roll back their health, and
more importantly if it was an inventory item like a weapon, just dissapear?
It seems like it would be happening frequently if people with high latency play and their on the same team. And if it was a weapon it could cause
other problems like the second player would change weapons locally but then rollback to not being able to so they could've been using their one already eqquiped.

Would this be the correct approach or is there other ways?

Reason why I am asking is becuase on online multiplayer games, I don't really notice this happening. So I am not sure what to do..

bitter oriole
#

One common way to handle this is a hold-to-pickup action where you hold for one second. Server replicates who is current trying to pick up the item, and if someone is picking up you can't start / your progress is cancelled

uncut schooner
#

Although, for a fast paced shooter, it'd mean you gotta risk standing still for a second

bitter oriole
#

Obviously that solution is of the "latency" category yes

#

If you want fast-paced you probably want prediction and rollback

uncut schooner
#

The only issue then is if two people from different teams want to grab the same gun, then it locally pulls it out and one guy gets rolled back, but could've been using melee or firing with his other weapon

#

I don't understand, Because in other games I don't see this happening

#

Like in Apex (Although tbh haven't played it much) or other FPS games where you can pickup a weapon

bitter oriole
#

That's what you get by doing nothing at all - just replicating the owner of the weapon

#

It's not a horrible solution to the problem and most of the time will be quite invisible (200 ping is nearly unplayable)

#

The only issue is that you have a 200ms window, for a max-ping player, where nothing happens

uncut schooner
#

Thanks, for the help

#

Ill try a few implementations

bitter oriole
#

There's also one method I used once where the server simply grants whoever is closer the pickup - which is something that can actually be predicted

#

On the server, if any player is gonna be in pick up range in 200ms (that being the max latency of all nearby players), then grant it

#

Only works well if there's no action needed of course

uncut schooner
#

Ok interesting, gtg to work now

#

Thanks, chat soon

dusky yoke
#

Hey guys, I've implemented this tutorial series into my game, adding Steamworks API to the project: https://www.youtube.com/watch?v=BLKn_yJfLxc&list=PLL0cLF8gjBpqCe9pzVWyW9Jk2lY4qioFr&index=9

I have port forwarded my port to 7777, and my friends are unable to join. If I close Steam completely, Im able to see my server session on a secondary client, but not if Im connected to Steam. This does not affect my friend's visibility of the server though. Do you have any suggestions as to figuring out how they can join my server?

Hey there Virtus Hub, in this video we introduce you to some basic replication using Unreal Engine to make sure all clients see the right information when they need to.

You will need:
http://bit.ly/2JvO4Fm
http://bit.ly/2VMI2lj

Instructor Partner: Ryan Hobbs
https://ryanhobbs.myportfolio.com/

β–Ί Virtus Hub Clothing: http://www.Virtus Hubmerch....

β–Ά Play video
twin juniper
#

Hi!

#

I'm using this code for wsad movement

bitter oriole
twin juniper
#

But it only works on sessin host, and not on the client

#

what am i doing wrong?

#

i tought this would work out of the box

dusky yoke
bitter oriole
dusky yoke
#

Also, using dedicated servers requires a source build right?

bitter oriole
#

So - dedicated server = one machine hosts and doesn't play, source build required, etc

#

Listen server = one player hosts while playing

dusky yoke
#

Yup! πŸ™‚ Listen server is the approach Im taking for now

#

Dedicated servers seem a bit out of reach for me right now :p

#

But yeah, trying to join my game etc does not work, along with finding sessions

bitter oriole
#

So if both players have a valid Steam account, the same build, the Steam overlay is working, no one is playing in the Unreal editor - it should work

#

Assuming one player started a session etc

dusky yoke
#

Wait, I cant have my Editor open?

bitter oriole
#

No, editor completely disables sessions

dusky yoke
#

Oh okay. I had it open while testing the .exe, but yeah, still doesn't work after that

#

But 7777 is the correct port to have open, right, or what do you mean by open ports not being important when using Steam? The tutorial above doesnt actually include a "Server IP Join"-input, so there's no IP's or port options when choosing what server to join - it should just pop up in the serverlist

bitter oriole
#

There is also no need to use any IP address

#

You are joining a session

#

What happens underneath is Steam's business

dusky yoke
#

Hmm, okay. Damn, must be something wrong in my code then..

stark tree
#

is it confirmed that they will be doing this?

bitter oriole
#

So yeah it's confirmed

stark tree
#

Oh wow I had no idea, thank you!

#

I thought UE5 isn't yet ready for live builds of video games like Fortnite

dusky yoke
bitter oriole
bitter oriole
#

I would say that right now the engine is quite viable for production, though I'd hesitate to actually release a game right now

stark tree
#

Fair enough, its awesome for Epic that they have built such an incredible engine in-house so they can benefit from it

dusky yoke
stark tree
twin juniper
#

Do i need to send this to server in order for this to work?

#

via remote calls?

sonic island
#

What are Pawns and PlayerController remoterole and role supposed to be?

bitter oriole
#

Depends.

sonic island
#

For owning client

#

and server

#

and other clients

#

lol

#

i just wanna know how ue works

twin juniper
#

i think the pawn is supposed to be authority

slow perch
twin juniper
#

It's not that

slow perch
twin juniper
#

i did print string, scale is being fed to add input movement node

slow perch
twin juniper
#

yes, that's all valid

slow perch
twin juniper
#

might be something on the character movement component, some setting

#

or the actor itself

slow perch
twin juniper
#

i'm not sure how to troubleshoot

fathom aspen
# sonic island .

I will assume, that the pawn is possessed by the player controller and owned by it. Thus the answer for both not gonna differ, and I will refer to both as the "player".
On the server, the Role/LocalRole is Authority for my player and for other players. The RemoteRole is AutonomousProxy for my player and SimulatedProxy for other players.
On the client, the Role/LocalRole is AutonomousProxy for my player and SimulatedProxy for other players. The RemoteRole is Authority for my player and for other players.

dusky yoke
#

Hey guys.

In my project my players can kill eachother. If they kill eachother plenty of times, the server begins to lag. Clients don't lag, but the gameplay mechanics obviously lag due to the server being lagged out. What could be causing this?

twin juniper
#

How would I go about UWorld::ServerTravel in blueprint?

thin stratus
#

Execute Console Command

twin juniper
#

Can I simply type -servertravel levelname?

radiant jolt
#

do the absolute path of the level tho

twin juniper
#

this is for non seamless

twin juniper
#

Every guide I look at is aimed at seamless as it seems to be a difficulty people have, but it's difficult finding info on non-seamless
And the documentation says you must use non seamless in certain situations like opening a level for the first time

#

Looks like there's a ton I don't understand and most people resort to C++ here. I am running my logic in gamestate (I know game mode has a 'seamlesstravel' option but I am doing non seamless)

#

And it's a host:client model not dedicated

young lily
#

Hi all, I'm trying to assign joining client player pawns a color. Does the following approach make sense, or am I doing something fundamentally wrong here?

  • Colors are assigned in the game mode in the OnPostLogin event. I set the newly joined player's color as a field in their player state there.
  • In the player pawn BeginPlay Method I call a BlueprintImplementableEvent "SetColor" and set the color via a Blueprint that changes the material instance properties accordingly * this accesses the player state which I assume should be valid at this point
  • The color changing stuff works on it's own, I'm just having problems with reliably setting the colors. This seems to sometimes (randomly?) work, but there's probably a few things I'm missing.
twin juniper
#

Oh I saw on a Q&A somewhere online that server travel only works in packaged? IN which case I should worry about this stage later.

#

How are you setting the colours? I remember I had trouble assigning colours to players but got it sorted in the end

fathom aspen
thin stratus
fathom aspen
#

Also I guess the event for setting the color shouldn't be a BlueprintImplementableEvent you should use a Multicast RPC

thin stratus
#

Normal servertravel as well as hard travels for connecting/disconnecting work in pie too

fathom aspen
# fathom aspen Also I guess the event for setting the color shouldn't be a `BlueprintImplementa...
thin stratus
#

That's also not correct

#

The color should be an OnRep property

#

And you set the material color property in the OnRep function of the property

#

No rpcs needed for something like this

#

Set the Color on Post Login on the PlayerController and if needed also on the PlayerState

#

In the Character, use On possessed to grab the color and set the OnRep variable

#

That's all

#

The variable in the PlayerState can be a normal replicated variable if you don't need the event

twin juniper
#

Ok thanks - here's my logic if you could maybe offer any insight into what I am doing wrong - hard to diagnose because I am not sure if I'm doing something fundamentally wrong, or just having syntax errors

Also if I need to type in the URL of the map, I am not sure if it should be the URL as it appears in the UE editor, or as it appears in file explorer

thin stratus
#

Ignoring the PlayerControlls stuff, this seems fine

#

Can't tell you what's wrong without knowing the error or your log (:

twin juniper
#

My error is, the level simply doesn't load. If I do open level on server (or try multicasting) only the host travels

thin stratus
#

You don't need to multicast

#

And open level is wrong for hosts that need to change levels

#

Open level will literally disconnect everyone and turn the host back into a standalone client

twin juniper
#

ok, noted

thin stratus
#

ServerTravel MapName should work fine. Only thing I can imaging is that you don't have the Map in the Maps folder, which should be visible by the log saying it can't find the map you try to browse.

#

Or you are trying this with Seamless enabled in PIE

#

Which is not supported

twin juniper
#

I notice you say ServerTravel not servertravel, does syntax matter that much? I am always paranoid I made a syntax error

thin stratus
#

Not sure

twin juniper
#

How would I turn off seamless in PIE?

thin stratus
#

Seamless is a boolean on your GameMode and it's a bad idea to turn it off

#

The whole flow of code execution is different

#

E.g. Seamless traveling doesn't call PostLogin on the GameMode

#

So you would need to code for both cases. Just test the traveling in standalone

#

Right-click UProject file and hit Launch Game

radiant jolt
#

Is there a clean way to send everyone in one server to another server. then destroy the old one? Or would you have to iterate through the connected clients and host and do client travel on each

dusky yoke
#

Can HUD warning errors generate lag? Killing players generates a HUD "accessed none", as it still tries to reference the player character, which is destroyed. Ive tried to remove the widget from parent upon death, but that does not alleviate the problem. Getting extreme FPS drops after 10-15 kills online. Any takes guys? πŸ™‚

radiant jolt
dusky yoke
# radiant jolt wherever you reference the hud just do an is valid check first

Yeah Ive added IsValid reference checks for the demo character in the HUD, but that leaves me with one error, which comes from the UberGraph, and when I click it no nodes are selected for troubleshooting. Im guessing its the On Initialize, and as such Im checking there, and still getting the error πŸ˜… Thanks for the reply!

radiant jolt
#

Maybe unparent before player death?

fathom aspen
pallid mesa
dusky yoke
#

Oh, thats pretty bad resolution..

radiant jolt
#

its ok i can see

twin juniper
#

log is not reporting anything, simply level doesn't open - though if I exit the server window, the two clients teleport the the default map thonk

dusky yoke
radiant jolt
#

@dusky yokecan i see the error

twin juniper
#

oh wait it is working, it's just very, very slow to respond

dusky yoke
#

I.e client killing the server:

radiant jolt
#

its probably a replication error. If the server kills it and it's not replicated, the clients will still try to reference it but wont get anything

#

right before the remove from parent do an IsValid on the reference

dusky yoke
#

Yeah its printing not valid πŸ€”

#

That death event is executed by Event AnyDamage tho, which should run on the server right?

radiant jolt
#

yeah but then you have to multicast it

dusky yoke
#

Hmm, I set it to Multicast but still prints invalid

radiant jolt
#

so set that custom event to run on server

#

then make another that runs on multicast

#

and hook that into your logic

#

and hook the server function to call the multicast

dusky yoke
#

Wow, okay that removed alot of the errors indeed! The IsValid still prints invalid though - removing the IsValid left me with just these errors (server killing client, and client killing server):

radiant jolt
#

if it works as expected just leave the IsValid and have it do nothing when its not valid

dusky yoke
#

Okay πŸ™‚ The RemoveFromParent node still generates errors, but alas - much better than before! πŸ˜† Alas, I am still getting those huge FPS drops though. Every time I kill the other player the FPS drops by 3-5 ish

radiant jolt
#

Is it possible the parent is getting destroyed too

#

what are you parenting the widget to

twin juniper
#

You shouldn’t put this logic on the pawn anyway.

radiant jolt
#

lol I didn't even realize it was on the pawn

#

what he said

twin juniper
#

You first put this logic in your widget (a function or whatever), you might want to have an AHUD also that will spawn ur widgets, and have a reference of them, then you call those HUD functions on your PC.

dusky yoke
#

The death event? Whew, it's from a networking tutorial πŸ˜…

twin juniper
#

No

#

The widget stuffs

thin stratus
twin juniper
dusky yoke
#

Ooh, the widget stuff! Hmm, got'cha. That's from a networked asset I bought, so figured it was common practice. I guess I gotta customize this quite a bit πŸ˜…

#

So I should be spawning the HUD in this case, and the HUD has reference to all the widgets? (atm on BeginPlay the HUD User Widget is being added to viewport)

fathom aspen
thin stratus
#

???

#

You don't teach shit just because it works wtf

twin juniper
thin stratus
#

What's next, put everything on tick cause it works?

#

A Multicast for a State Property is wrong

#

It literally causes bugs

#

Next player that joins or comes into relevancy range won't see the color on the clients.

twin juniper
thin stratus
#

There is usecases for Multicasts and there is usecases for OnReps

fathom aspen
#

You could say it's not efficient. Not correct means something else.

dusky yoke
twin juniper
#

Also if someone joins later, good luck

thin stratus
#

If it causes bugs then it's not correct

#

Has nothing to do with efficient

fathom aspen
thin stratus
#

...................

twin juniper
thin stratus
#

Do you even know the difference between Multicast and OnRep?

twin juniper
#

Also if someone joins later, good luck

thin stratus
#

And why they exist?

dusky yoke
#

But you guys think the HUD reference issues are related to my framedrops?

fathom aspen
thin stratus
#

"Not good". It breaks the "state" of the Actor for them

#

And also for already connected clients that are out of relevancy range

#

Which can't be fixed with Multicasts

rapid bronze
#

OnRep is a must for persistent states

thin stratus
#

You use OnRep variables for this

rapid bronze
#

Multicast is good for stuff you don't care to be persistent

thin stratus
#

If you think you can do it with both solutions and one is just a bit less efficient, then please read up on the difference again and don't teach peeps wrong things.

#

Next week they come back and ask why their color isn't visible for people that join later

#

And not even joined later, this will probably not even work for the people that move servers

twin juniper
#

Cause all time an actor enter in the relevancy range of another he gets the relevancy actor properties replicated on its own (so executing OnRep etc)

dusky yoke
twin juniper
#

And RPC are not reliable

thin stratus
#

The first Client to arrive from a ServerTravel will receive the Multicast, and every other one won't

twin juniper
thin stratus
#

Has nothing todo with Cosmetic stuff either

#

Spawning an Explosion VFX is cosmetic, yet it's an RPC

twin juniper
thin stratus
#

It's a matter of State vs not a State.

fathom aspen
twin juniper
#

But yeah it depends, new clients doesn’t need to know about an explosion that is during 2sec, same for non relevancy actors

#

I was talking about persistant cosmetics like the first thing u was talking about (mesh Color)

thin stratus
#

Barrel explodes:

-> Explosion Sound and VFX, etc. is an RPC (if Clients can't predict it)
-> Barrel Mesh being broken and looping fire vfx ontop is an OnRep

thin stratus
twin juniper
thin stratus
#

Was posting that in general, not only for you :P dw

thin stratus
#

It got a lot less since the Compendium is out

#

But I fully understand peeps would rather go to an official tutorial

twin juniper
#

Only things I saw explaining the good uses of RPCvsOnRep when I was learning was some post on the UE4 community wiki

#

But it has been killed since

#

All old posts are unreachable ryryWsh

thin stratus
#

The Wiki is community hosted by now

#

But the links are of course dead

fathom aspen
#

That's good. After all we're all here to learn. Believe me I don't post answers here because I learned Unreal a week ago. Sometimes I give answers because that what came at the top of my head. It's not the end of the world if it was not a good one though!

fathom aspen
thin stratus
#

No worries, glad it helps

thin stratus
fathom aspen
#

Haha, it's ok man, I'm happy that I was corrected!

light iron
#

eXi you've been using GAS at all?

thin stratus
#

Yeah, roughly two years for The Ascent, and recently in some Singleplayer Projects.

fathom aspen
#

πŸ”œ GAS Compendium?

thin stratus
#

That's already a thing from Tranek/Dan :P

fathom aspen
#

Wait...Really? How I missed that

#

Niceee. That will be my next read πŸ˜„

young lily
quasi tide
thin stratus
thin stratus
young lily
#

still trying to debug why my color is now reliably replicated to blue.. for every player πŸ˜„ I know you suggested setting the color choice in the PostLogin in the Controller, but logically I liked it better in the game mode, hope that is not terribly wrong

quasi tide
#

Yeah - GAS has a huge steep learning curve. More of a hill than a curve 🀣

quasi tide
#

In concept - it can be kind of simple. But in practice - eek.

thin stratus
#

GameMode::OnPostLogin can set the Color on the PlayerController.
Pawn::OnPossessed can retrieve the Color from the PlayerController (it gets passed in via the Event) and set a OnRep Color Variable.

#

That way you can also destroy the Character and respawn it and the color is persisted

#

And you can move the Color between SeamlessTraveling via OnSwapPlayerControllers in the GameMode.

young lily
#

Yeah, I have the color in a OnRep variable in the player pawn now, as well as the player state for the case when it's destroyed

thin stratus
#

You can also additional retrieve the Color from the PlayerController in the BeginPlay of the PlayerState (SwitchHasAuthority)

#

If you need it for UI or so

#

I can't comment on it being Blue for all for you, sorry

young lily
#

GetLocalRole == AUTHORITY should be pretty much the same as the SwitchHasAuthority node, right?

thin stratus
#

Eh, the roles always confuse me

#

Don#t want to say something wrong

fathom aspen
young lily
thin stratus
#

The setup should be relatively simple and straight forward. If you always get blue, try to print the variable in every place you can and see if it's always blue or if the info gets lost somewhere.

young lily
#

I'm trying to understand the bigger picture.. Structure wise your network compendium doc really helped, but in practice I'm still learning a lot (or better worded, making a lot of mistakes :D)

quasi tide
#

That's fine. Just keep at it. It'll come eventually.

#

(I still fight with getting some UI elements states set up properly at the start of a map when dealing with networking πŸ˜…)

young lily
thin stratus
#

Does that somehow help?

#

Structure wise?

#

The OnRep ServerSide is only important if this is a ListenServer

#

Also I'm pretty sure some British person just lost it reading this

pallid mesa
#

just one tiny little silly detail: in C++ onreps don't get called on the server uwu (so be aware that this is different in BPs!)

young lily
#

Oh wow, a custom overview πŸ˜„ Thanks! That seems to make sense, I'll adjust it as follows. So just another question: Setting the variable in player state from game mode is not valid? I should set it in the controller first?

thin stratus
#

Ah, you could set it from the GameMode, but this way you don't have to call it on two classes

#

And the PLayerController is the Owner of the PS anyway

#

Makes it easy to have one source of truth

#

But that's just specifics. You can do that however you want. The PS should be valid on the Server when PostLogin calls, cause the PC creates the PS

#

Client-side, things might be a bit trickier :P cause replication can take time, but you are only performing replication with the Color variable ,so that's fine

quasi tide
#

Wasn't there another call on the GM that happens after PostLogin but does get called on map travel πŸ€”

thin stratus
#

And yes, C++ doesn't call OnRep for the Server, BPs do cause they are not actually OnReps but rather "The Variable has changed."

quasi tide
#

Feel like someone told me before about it before.

thin stratus
#

You have 2-3 different ones, depending on what you need

#

PostLogin calls on Connection

pallid mesa
thin stratus
#

HandleSeamlessTravelPlayer calls after seamless traveling

#

And Something something InitGenericPlayer or so calls for both

#

Can't come up with the name

#

But Blueprints might not have access to those

#

For the Color it's kinda okay to just set it once on login

#

And then drag it through the level changes with OnSwapPlayerControllers (GameMode) and OnCopyProperties (PlayerState)

#

Unless you wish to always reassign it

#

But Multiplayer with C++ is also a nightmare :P

pallid mesa
#

are these two on Blueprints now?

#

the OnCopyProperties and OnSwapPC?

thin stratus
#

Yes, I exposed the first, and the other was already there I think

quasi tide
#

But Multiplayer with C++ is also a nightmare πŸ˜›

Fixed it

pallid mesa
#

ole! good to know, didn't know... too dependent on C++ πŸ˜…

thin stratus
#

OnOverrideWith was also exposed alongside CopyProperties

#

But that was ages ago

#

Can't even recall which PR

quasi tide
#

gosh darn it. The strikethrough ain't workin'

pallid mesa
#

what's OnOverrideWith for?

thin stratus
#

Eh, I thiiiiiink for reconnecting

#

But I said that wrong once

#

So not sure

#

When you leave your PS is put into Inactive Mode for x seconds (unless otherwise setup)

#

If you reconnect it tries to find the PS again

#

And then calls OverrideWith

#

And that one was super confusing,

quasi tide
#

Ahh - there. Got the strikethrough to work

thin stratus
#

Cause it gives you the old PlayerState back

#

And then calls OverrideWith on that, passing in the new one from you just having joined

#

Which caused me some hours of headache and debugging cause I expect to keep the new one and to have OverrideWith being called on that with the old one being passed in to take any info I want to keep from the inactive one

pallid mesa
#

so it gives you back the properties from the old ps?

thin stratus
#

Yeah + the change to override properties of the old one with the properties from the new one

#

Which I haven't yet figured out a usecase for :D

quasi tide
#

@thin stratus HandleStartingNewPlayer is the other PostLogin-esq function I was thinking about.
#multiplayer message

pallid mesa
#

aham XD good good

thin stratus
#

Maybe if you get a new Team Assigned on rejoining

#

And you want to override the old playerState that you then getb ack with the correct team

#

Otherwise you still run around with the team you had when you left, but that's just an idea

pallid mesa
#

ye I see

thin stratus
#

Cause PostLogin won'tcall again if you SeamlessTravel when ServerTraveling (and you should always do that)

iron glacier
#

Hi!
I have a question about Multiplayer and replication of destroying actors.
I have a custom event which executes on owning client.

  1. Before it finishes it calls another event with actor parameter the event is executed on the server.
  2. The server event then calls a multicast event to destroy the actor parameter that is referenced in the server event.
    I am not sure as to why this would not destroy the actor on both owning client and all the other clients.
    Can anyone give me some pointer?
quasi tide
#

Shouldn't need the multi-cast to destroy the actor on clients (as long as the server is the only one who spawned actors). Simply destroying it on the server should be sufficient.

iron glacier
#

Hmm ok I guess I must be spawning wrong. I am also multicasting that -_-"

quasi tide
#

Only have the server spawn actors - then it'll automatically replicate to clients (as long as you have the actor set to replicate).

#

Same with destroying an actor.

iron glacier
#

Ok I'll go check another tutorial for multiplayer spawning since I am not sure as to why it doesn't spawn on the client even though it is set to replicate on the class defaults

#

Thanks @quasi tide πŸ™‚

thin stratus
#

Usually cause you forgot to mark it as replicated :P

iron glacier
#

@thin stratus Not really the case here but thanks for the suggestion πŸ™‚

sonic island
#

My FText is replicating but the text is Text. When I modify the text it changes on the server not the client.

twin juniper
young lily
#

@thin stratus just wanted to say thanks for your help! It works now! Somewhere the chain of the many nested calls I forgot to set the value from the parameter πŸ€¦β€β™‚οΈ

twin juniper
sonic island
dusky yoke
#

How can I check with Advanced Sessions if a player has force quit the game? Need to destroy the player's actor in that case

twin juniper
#

The pawn is already destroyed when quitting a server

#

If you are talking about pawn owned actors like weapons, then yes you need to handle that on your own, generally EndPlay is the place to do that

dusky yoke
#

Cheers!

#

Is EndPlay replicated?

latent heart
#

Destroying the actor and any peripheral actors will be replicated.

dusky yoke
#

Thanks guys πŸ™‚

sonic island
#

How does destroying the actor get replicated like in ue4 source?

latent heart
#

Destroying actors isn't replicated now?

twin juniper
#

That’s not the point there

#

She was talking about pawn owned actors

latent heart
#

Doesn't make what I said wrong, though.

twin juniper
#

"Destroying the actor and any peripheral actors will be replicated." this is not true at all, if your weapon owner is your pawn you still need to destroy it apart of your pawn

latent heart
twin juniper
thin stratus
# dusky yoke Is EndPlay replicated?

EndPlay happens naturally on every Actor for various reason, one being "Destroyed".
It's not directly replicated, but since the Instance on the Clients also gets destroyed (this part is replicated) it will call EndPlay for them.

#

So if you want to destroy and clean up other replicated actors that you spawned for the pawn/character, you want to guard and check for authority on EndPlay

latent heart
#

Unless they're local actors, ofc.

thin stratus
#

It really reads like you wanted to say that additional actors will automatically be cleaned up too :P

fathom aspen
shadow aurora
#

Ok so weird question. I am implementing a sort of "downed state" in the game I'm making by swapping meshes. However, the original skeletal mesh's physics asset is still there after using SetVisibility(false). How can I go about making sure that the physics asset is "gone" without destroying it? Do I just need to disable collision on it temporarily?

hollow eagle
#

pretty much

#

call SetCollisionEnabled(ECollisionEnabled::NoCollision) on it.

#

If you want to change it back, call SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics) (or whatever it used to be)

fossil stratus
# thin stratus It really reads like you wanted to say that additional actors will automatically...

Just saw your name and I really wanna thank you so soo much for creating the Network Compendium!
Its my bread & butter whenever i start on multiplayer projects and always the first resource that i check out when troubleshooting. I love how it is highly in depth but at the same time super fast and easy to understand. Can't imagine the amount of hours that went into it.
My first real unreal coding project was a little fps game in university when I was only an 3d artist and we lost out coder, the network compendium was a huge help in getting a grasp of how multiplayer works, and trough that project I got really interested in the coding(bp) side of unreal without you I probably would have never chosen that path. So really big thanks from my side.
Hope you're having a great day! Keep being Unreal!

thin stratus
quasi tide
#

I do the exact same thing πŸ˜…. "This isn't working - what did exi say?"

thin stratus
#

Haha

#

Gotta sleep now though, it's late in Germany (:

fossil stratus
molten vine
#

@dark edge Thanks for your help bruv! I'm going to learn a lot more about AWS and figure out how to get some of my own systems working! Gotta get dat knowledge.

boreal wadi
#

If I have code to alter the skeletal mesh and the materials before a character is spawned by the server shouldn't those things replicate? What would I need to change to get that to work? I have a function that runs only on the server as well as calling a client function but in PIE the clients cant see one another but the server can

dark edge
#

Are you actually changing mesh properties or just changing which mesh is used?

boreal wadi
# dark edge Define alter

I have a base character blueprint which has empty variables for the skeletal mesh and I change the mesh depending on what the player selects as their character. The server spawns deferred, updates all the data (the mesh, the materials, the anim instance) and then I call FinishSpawning the server is proper the client is still empty

hard hinge
#

Does anyone know about this?

#

This channel is probably the better place to post this question

#

Looks like it's used in postlogin

pastel fable
#

anyone know an easy way to set up simple multiplayer in your project to play with your friend?

#

nothing fancy, Im just a 3D artist thats really bad at coding lmao

dark edge
pastel fable
#

oop I meant simple*

#

thanks for pointing it out

dark edge
#

Easiest approach will be to forward the port for Unreal (7777 i think?) and have a button to call open YourIPAddress

#

or just use the console to do that

#

that's the bare minimum to get your buddy playing on your screen or vice versa

pastel fable
#

I didnt understand a single word but thanks for the help!

dark edge
#

Then don't do multiplayer lol

pastel fable
#

gotta try somehow

dark edge
#

If you're just wanting to mess around, that'll be enough to get a connection. You won't need to deal with port forwarding if you use Steam or whatever but that's not Day 1 territory

boreal wadi
# dark edge RepNotify MyMesh and MyMaterial

I did something like that. So the information that is updating my character is from a replicable data asset. I used a rep notify on it and now im able to see myself on my own client. However I still cant see the other clients but I can see them interacting with the world. Mind you the server is still running all of the logic that updates the mesh, materials and animinstance so shouldn't they show up?

pastel fable
#

fair enough

dark edge
#

@pastel fableYou on the same LAN or over the internet?

pastel fable
#

Internet

dark edge
pastel fable
#

ive been learning coding for 3 years now, and trust me I keep trying but I have a hard time understanding even the basic concepts. Thanks for the support though!

dull tinsel
#

You might just be getting ahead of yourself. If you've been trying for three years and are still fuzzy on the basics, maybe go back and focus on the basics

mellow stag
#

Does anyone know why I am getting this weird stuttering?

dark edge
#

I do most of my stuff with onreps on either enums or pointers

#

love it

hollow frigate
#

I think I'm doing something wrong

Summoning a Pet-
Event is trigger -> Run Server event
Server -> Run Client event
Client -> Run the summon a pet

Client can see their own pet and the server pet but they can't see other client and server don't see any client pet.

What I'm doing wrong?

fossil stratus
#

Hey guys,
I got a little tank arena game in the making and strugeling to find an optimal way for custom movement replication.
This is the system i currently have in place.
Basically I start a timed function on an input action, that moves the player locally for everybody, when the input action is released the timer stops and the location gets updated with the server location.
I had no luck yet getting some sort of smoothing system on top of that to work, and I already tried to add some more server location updates regulary but without smoothing its stuttering a lot & i dont wanna send to often over the server.
I am also not sure if rpc calls are the way to go here or if maybe some sort of repnotify event would be better, or if c++ is the only realistic way to go for a simple custom movement replication.

fossil stratus
quasi tide
#

Only the owning client has knowledge that an actor spawned. Neither the server, 'nor other clients know that something needed to be created.

hollow frigate
quasi tide
hollow frigate
#

will do thanks

mellow stag
dark edge
#

What's the Correctβ„’ way to do a dash or knockback in the context of the CMC?

#

Is a dash a movement mode or something on top of walking?

ashen stone
#

Is there any way to debug it?

#

i created a sprint ability for multiplayer movement but it is snapping

#

maybe this settings can make it bad?

haughty magnet
ashen stone
#

but i`m doing it

ashen stone
#

The change is happening on a Local Predicted Gameplay Ability System, it happens on both sid

dark edge
#

Not sure if GAS can cover it for you, sprinting is more complicated than just setting max walk speed.
https://www.youtube.com/watch?v=RtQRMcupJs0

Support the channel through donations. Crypto accepted!
PayPal: https://paypal.me/reidschannel?locale.x=en_US
Patreon: https://www.patreon.com/reidschannel
Bitcoin: 1JFwWHr4X6uAeoZadukzqKjzFBj3Qjy7Sk
Ethereum: 0x2B2Bc108F1Cc0fF899959dEF3226637787d8C3dE
Dogecoin: DNQ33YnhpWoTBokBNVkZP5ub8KTLkpyjpv

Join our community discord!
Discord: https://dis...

β–Ά Play video
ashen stone
plucky prawn
#

are any of the world times replicated? like TimeSeconds?

bitter oriole
#

Game state has a shared time

marble gazelle
#

but it's actually not that accurate as it relies on Property replication which can basically happen any time^^ So I'd look for a better solution if you have system rely on timings.

chrome bay
#

I like to bounce RPC's back and forth myself, I find it tends to be a bit more accurate

#

Similar idea though

bitter oriole
#

Personally I have my own shared time that's guaranteed continuous and stable - essentially the clients handle their own time but with a slight dilation to aim for (last replicated server time - current ping)

#

Works wonders, since usually you care a lot more about time being continuous rather than complete synchronism

plucky prawn
chrome bay
#

yeah

#

For a round timer you can just rely on the gamestate timer, that's usually fine

plucky prawn
#

awesome thanks

chrome bay
#

Just replicate a timestamp of when the match will end (counting down) or when it started (counting up)

plucky prawn
#

ye thats what im doing now

#

but im using GetWorld()->GetTimeSeconds() as my clock which doesnt work at all

#

there is easily 10s of seconds difference

chrome bay
#

yeah that time is local to when your local world started

plucky prawn
#

oh

chrome bay
#

GameState has a GetServerWorldTimeSeconds() which is sort of what the current server world time is

plucky prawn
#

oh

#

thanks

chrome bay
#

It's good enough if you don't need something that's uber accurate

plucky prawn
#

nah. not sure what sort of expectations but even if its like half a second either way should be fine

#

i dont know if thats too much to ask

chrome bay
#

nah that's fine

hallow summit
#

on client one player 2 shrinks, but on client 2 player 2 doesnt shrink, how would i replicate that, run on server multicast before shrink code doesnt work

marble gazelle
hallow summit
#

when the big guy touches a normal sized guy they shrink, and it's working on the right screen, but on the left screen they stay normal size

#

i dont know how to replicate this code so the size changes on all clients

marble gazelle
#

If it is fine its simulated you just need to replicate the initial event to start the shrink, then the clients simulate what needs to be done to shrink your actor

hallow summit
#

usually run on server into multicast will replicate but its not working for this

marble gazelle
#

Well then I'd start debugging if the RPC is received at all

hallow summit
fathom aspen
marble gazelle
hallow summit
#

with a print string after the overlap event client 1 is the only one that says it

marble gazelle
#

the overlap event is a physics event, not an RPC

hallow summit
#

is there a way to make the overlap event an rpc?

bitter oriole
fathom aspen
fathom aspen
dark edge
#

@hallow summit make it state driven. Either use replicate movement which I think can replicate scale? Or repnotify a variable.

#

Whenever you can, make things state driven and not reliant on events.

#

It is in the state of being shrunk, not so much that a shrink event happened to it.

#

Onrep bIsShrunk -> do shrinking/unshrinking stuff

hallow summit
#

i got it working finally thanks for the help

real ridge
#

guys I have problem with saving name in player state πŸ˜„ I want to save name in menu to player state name its variable made by me and then in lobby i want to load this names of all joined players and make a table of them with ready or unready status and I just set name over cast to player state and nothing happens.. i dont know how to make it can someone help me ?

young lily
#

Quick question: Is the Actor visibility / bSetHiddenInGame replicated by default if replication is enabled for said actor? It seems to me that it's not, when I call ResetLevel() the Actors' visibility gets reset for the server but stay hidden for the clients

#

Oh, I guess actually the visibility is part of the UStaticMeshComponent soo that is probably not reset with the actor then, right?

chrome bay
#

bHidden is replicated on the actor by default

#

Component-level hidden states are not

#

I'd be surprised if ResetLevel even works properly in a multiplayer environment

#

The default Reset implementation doesn't do anything btw

young lily
#

I don't know about "properly", but for now it seems to do it's job - what could be the gotchas here?

chrome bay
#

just calls the BP event

#

Well the main thing is the Reset is only called server-side, so only replicated properties will take effect on clients.

mortal kernel
#

Does OnRep not fire when singleplayer?

chrome bay
#

no

#

Since nothing is replicating

mortal kernel
#

Can I make it fire? o-o

chrome bay
#

no

#

You can call it yourself, but that's not considered good practice

#

Usually if you have some logic that must be done after a value changes it's a separate function

#

The OnRep is purely a networking concept

#
{
    Bar = false;
    OnBarChanged();    
}

void OnRep_Bar()
{
    OnBarChanged();
}

void OnBarChanged()
{
    // do stuff
}```
#

Blueprint OnReps do their own thing because they're stupid and not really OnReps

young lily
#

I might have to check then if there are going to be any issues.. In my practice project I ResetLevel() and RestartPlayer() for each player after the match ends. Destructable Actors in the game environment are set to hidden and (at least now) reset their state properly - I did however override the Reset() method to reset visibility

chrome bay
#

Well looking at the implementation of it, all it does is call a Reset() function on every actor in the level. But it will only call it Server-Side

#

And the default implementation on AActor does nothing other than call the BP function

young lily
#

So as long as I stick to replicated properties I should be fine then

chrome bay
#

yeah

young lily
#

Cool, thanks

real ridge
#

omg why is everyone ignoring me...

marble gazelle
cold magnet
#

Is there a way to make blueprint class derived from UObject replicate?

chrome bay
#

Not in BP

#

They must also be an actor subobject

cold magnet
#

Thanks! I guess I should expand on my question regarding what I'm trying to accomplish

#

Since server RPCs can only be called from owned actors (i.e. controller or pawn), I'm trying to make a somewhat abstract system to enable me to implement the RPC logic in the affected actor itself, rather than creating a million different functions/events on the pawn for each actor I want to interact with.

The first screenshot is from my pawn class. I created a ServerInteract event that should ideally just call the respective function on the actor that needs to be interacted with.

And that is all good for a generic Interact event that doesn't accept any parameters. But since I sometimes need to pass parameters, or Data from the client (depending on the actor etc) I wanted to create a system where I would have only one event on the pawn, that would take any Data (basically any UObject subclass) and just pass it back to the actor that needs to be interacted with (second screenshot).

Is there any way to achieve this? Right now BP_PhoneColor is a blueprint class derived from UObject but replication doesn't seem to work for that.

If I went with structs instead, there's no way to have an any struct parameter and then downcast to it...

So how can we actually deal with this other than creating RPC events for all interactable actors in the pawn itself which I'd really like to avoid if possible?

thin stratus
#

There is a way to have such structs, but I think that is utterly cursed and even breaks with RPCs

#

I had someone on The Ascent how tried that for BP functions and the data that came back was kinda garbage

#

Think it was like only parsing the parent struct class in the end and all the child data got lost

#

I don't remember

#

But yeah, the UObject through RPC won't replicate

marble gazelle
cold magnet
#

Is there ANY other way to avoid having all RPC events on the pawn/controller then? πŸ™‚ any "best practices"?

tender acorn
#

Good time of a day to everyone! I have a problem with my "Destroy Actor" replicating, would you mind to help me solve it?

tender acorn
#

"Actor to destroy" goes from a functions`s output value and then write it to variable with replication, so very this one i wanna destroy. But it still on the scene..

bitter oriole
cold magnet
#

@bitter oriole could you please expand on that? Either here or in PM

marble gazelle
#

is the actor replicated? Looks like, shouldn't it be enouhg to delete in on the server?

tender acorn
bitter oriole
#

Will need C++ though

tender acorn
#

So what exactly i have to do? πŸ™‚

marble gazelle
#

To be clear, you can write UFUNCTIONs with RPC logic also in Components, they don't even need to be set to replicated for it

bitter oriole
tender acorn
#

It needs to be called from a server?

bitter oriole
#

Replicated actors can only be destroyed on the server

#

Destroying them on clients does nothing

tender acorn
tropic falcon
bitter oriole
tender acorn
#

Every action which server does immidiatly goes to all clients?

tropic falcon
#

If your actor is replicated

tender acorn
#

For sure

real ridge
#

Hello guys I have question I am making multiplayer game and want to majke lobby where I can see player names and if they are ready then coutdown and start map but i have problem I want to save their nicknames into playerstate I made I am using editable text where player can put name I created also name variable (text) in playerstate which I am setting inside blueprint in firt widget but it will never save there I dont know why.... so then If i try to print names I see only "none" because its default for Name in playerstate can someone help me ? here is how i have it now but it doesnt work

marble gazelle
#

well, that's not how it works xD

bitter oriole
marble gazelle
#

you should hook your control flow into that what your getName event is calling

bitter oriole
#

Some other things like attachment

#

Most don't

real ridge
marble gazelle
#

it simply can't work

real ridge
#

i thought that if I have variable name ticket as replicated its good

marble gazelle
#

hm wait, I miss smth

real ridge
#

but idea of savings name etc inside customplayerstate for multiplayer is good ?

#

or better to save it in player character ?

#

blueprint

#

i am newbie in it soo....

marble gazelle
#

the idea it self is fine

real ridge
#

sorry for dumb questions πŸ˜„

marble gazelle
#

I think the issue is, that you need to send an RPC to the server

#

as property replication is Server -> client not the other way around

#

so you should call an RPC to the server after your input is done

real ridge
#

so custom event run on server and then call custom event which multicast for all?

#

or its not like this

marble gazelle
#

if the name is replicated it should be enought, if the server updates the value

real ridge
#

i will try

#

make multiplayer is really hard for me πŸ˜„

marble gazelle
#

tbh I wouldn't start with a multiplayer game^^

real ridge
#

i still dont get when need to multicast , or run on server

real ridge
#

we are learning this

marble gazelle
#

multicast: Message from server to all clients.
Server: message from client to server, if you "own" the actor

real ridge
#

i go to try i just dont clearly understand multiplayer logic or I am just not used to multiplayer stuff

#

I have done before score for players same way but i see I had there RPC ohhh my gosh

#

πŸ˜„

boreal gazelle
#

Me and 16 friends are playing a multiplayer game (made in unreal 4.27). Here is a bug I can't crack:
15 people are running on the primary start point down a street before turning left toward a distant park. everyone sees everyone's 'name' above the avatar. however, once i run outside the main street and toward the park - all their names disappear. Once I turn around and run back toward them (i'm on the main street again), their avatars are no longer the different characters they pre-selected and are instead the SAME avatar. And so am I.
so idk if when I get too far away, and the names of everyone else far away squish and causes too much for replication that it breaks it
or something about turning that one corner on that one block that breaks things.

marble gazelle
#

Despawning is distance based.
Why the models change I don't know, you need to check where these get set

real ridge
#

and @marble gazelle I have some other problem I have done dedicated local server on pc and I can run my game over icon or also inside editor if I run it inside editor everytime I see copy of first spawned player on map

#

dont know why

#

from folder its ok but sometimes its lagging not my window But if we are 2 there I see other one in hard lags but he is not lagging

silent epoch
marble gazelle
#

Well, I have no idea? Don't you have the source code?

marble gazelle
real ridge
#

i can show photo of first problem

silent epoch
marble gazelle
#

oO what do you expect from us? Using a marble? πŸ˜„

#

this literately can have a lot of reasons. For the despawn this is the simplest thing, just increase the distance, currently can't remember the property name.
For the visuals, this really is an implementation detail I don't know. In my game we replicate this with the player state and the actors just read the visuals it needs to load from there

real ridge
marble gazelle
#

No, I don't download anything from public discords

real ridge
#

ah its too big i will try to make 2-3 sec long wait πŸ˜„

#

or how can I show u it ?

marble gazelle
#

you could just explain in a bit more detail

silent epoch
# marble gazelle this literately can have a lot of reasons. For the despawn this is the simplest ...

I see thanks! I’ll share a little more context if it helps:
Each player can select their own avatar. When people join the game and select their avatar, if they look at players that joined before them, those players are all the default avatar; any players that join after them can be seen with the proper avatars.
We added a bug patch that addressed that, so all people see all the proper avatars, but now those visuals disappear once there is enough distance between them.
Does that help? Maybe show a fracture in how it works?

marble gazelle
real ridge
#

first player doesnt see it

#

but others yes

marble gazelle
#

do you have a player character placed in your level?

real ridge
#

no i spawn them over blueprints

#

only player start is there

marble gazelle
#

what do you spawn over blueprints?

real ridge
#

characters

#

i can choose 4

#

man , woman etc

marble gazelle
#

hm could be related^^

real ridge
#

its done like this πŸ˜„