#multiplayer

1 messages Β· Page 98 of 1

ocean geyser
#

yea, shes ma laday

pine sage
#

Hi, I trying to find out why the server vs client socket transform is different. Any idea ?

LogBlueprintUserMessages: [GA_HB_Class_Sec_Vomit_C_0] Server: Translation: X=6958.290 Y=3619.020 Z=223.899 Rotation: P=0.000062 Y=117.529180 R=179.999896 Scale X=0.150 Y=0.150 Z=0.150```
#

Location is slightly different, which is "fine"

#

but pitch is way different

ocean geyser
pine sage
#

well first thing is I don't want tu use Pitch control rotation, so that's why it's not replicated

#

there might be a tolerance, yep. because even If I get it replicated, it's way off ...

#

might as well call a RPC to get the right transform ...

#

Is there anyway to spawn an actor from a client and it gets replicated as well, as if it was spawned on the server ?

#

or it would be OK to just get the socket transform from the client and still spawn on the server ?

#

(as you might guess I am still learning replication, multiplayer stuff)

rain condor
#

Srry, i can't get it. I have to make an RPC on inventory component and then call it on my OnDrop?

quartz iris
#

How can I easily put all of these variables within the player character into the player state instead as I have not been replicating to my clients properly

#

I have referenced each variable within the player character

sinful tree
quartz iris
#

I know its a lot of work but I would be very grateful

#

If I can have one ability with replication i'll understand it better

#

This is for a "Mind Subvert" ability where the enemy gets blinded (a white widget canvas)

#

The abilities are selected with 4 perk slots

#

This all works in singleplayer just only some of it doesnt in multiplayer

#

This is the perk ability select function

#

I just cannot work out how to replicate the code

sinful tree
# quartz iris

The client and the server can both be doing the checks before attempting to execute the ability. Effectively, you can prevent clients from sending the RPC to the server in the first place if they don't have what is required, and then the server should prevent the execution.
You should use replicated variables for those checks as you are doing, making sure they're being set on the server when things are happening.
You don't need to multicast everything, only visual/audio things, like playing the animation montage. Otherwise, if you're trying to trigger an effect on someone like displaying a white screen, especially so if it's something stateful like a confuse, you probably want to use an OnRep variable marked as Owner_Only and in the OnRep check what the state of the effect is and either apply or clear the effect.
You probably want to avoid having casting chains like you've done with Phantom_BP and Light_Drone_BP - this is usually where inheritance or an interface is best used.
You may want "effects" to be a replicated actor that you spawn to cause effects on the actor they are meant to effect. This allows you to build out effects in their own class, have their own lifetime and their own sets of variables and functions.

Generally speaking an ability would work like:
Client Input > Check if requirements are met to execute ability are met > RPC To Server requesting activation of ability > Server validates requirements are met > Set values on actors/send RPCs to affected clients/multicast visuals. Of course, this means no client side replication, so you'll end up having some latency when playing online.

#

I work with GAS myself, so I've not really had much experience building out abilities and effects using basic networking in Unreal.

quartz iris
quartz iris
quartz iris
#

Why does the code not even work?

quartz iris
sinful tree
# quartz iris Why does the code not even work?

Based on the code you're showing it's because you can't do a run on server event on to the gamestate as it's not client owned, and to go further with that, death checks shouldn't be done on clients at all.

quartz iris
sinful tree
sinful tree
#

The AnyDamageServer event is redundant. Any Damage will only be executed on the server, so long as ApplyDamage is executed on the server.

quartz iris
#

Ok

#

Is that whats breaking the code?

sinful tree
#

Probably not. Are you even causing damage?

quartz iris
#

Yeah

sinful tree
#

So at what point is the code failing? Is there a particular node? Have you tried putting breakpoints to see where it stops doing what you want?

quartz iris
#

The breakpoint doesnt seem to trigger

tepid lark
#

anyone know why a collider would exist on the first time a pawn spawns but not on the second time it spawns

sinful tree
#

Find where it actually does work and the node where it stops working.

quartz iris
#

It doesnt show anything

#

Maybe I did the breakpoint wrong?

#

The saber/sword line trace is on the server within the character

#

Maybe because I have an apply damage there it ruined the code?

tepid lark
#

1000 times per second eh

quartz iris
#

yeah

#

I need serious help with understanding servers and clients man

#

lol

#

I have it f'ed up atm

tepid lark
#

try removing most everything except what you are trying to test, i.e. all the branches about blocking

quartz iris
#

It all works though

tepid lark
#

then what specifically isn't working

quartz iris
#

Up until the cast to gamestatebase

quartz iris
tepid lark
#

are you using gamestatebase

quartz iris
#

yes

tepid lark
#

and it's the cast to gamestatebase that is failing?

sinful tree
sinful tree
# quartz iris

Also, you should not be marking everything as running on server. Every time you're marking events like that, it's a means for the client to call it, and they can call it at any time, even if you're not intending them to do so in your code.

#

You mark only what you intend for clients to be able to tell the server to do something as "Run On Server".

tepid lark
#

Sometimes I mark run on server even if the server is going to run it. just in case lol

sinful tree
#

Don't do it.

#

It's allowing players to potentially "hack" your game and start causing all kinds of havoc.

oak pond
#

why am I struggling so much with this, I have some weapon pickups, and I want the pickup event to trigger only on clientside so that I can only replicate what I need to from there. but how I even specify which client to do it on if its not a player actor I dont get it

sinful tree
sinful tree
# quartz iris

So when you're testing this in game, and reducing the player's health to 0, it's not getting stopped there?

quartz iris
#

Although the sound of the death plays

#

"death cue"

sinful tree
#

Try something else - put a print string immediately after the cue that says "Foo bar". Test it, see if you get the print string on screen.

oak pond
sinful tree
oak pond
#

yeah

tepid lark
sinful tree
quartz iris
#

Ok the test text shows up on both the server and client

sinful tree
# oak pond yeah

The OnOverlap provides you with a reference "Other Actor" which then gives you a reference to the actor causing the overlap. You can gate the overlap so it only executes on clients using a "Has Authority" node which if you use the "Remote" path will mean it'll only execute on clients, not the server. From the other actor pin, you should be able to cast to your player character class. From that you should be able to trigger any RPCs to ther server you want in the character.

Ideally you would not do it this way however. A client can potentially "spoof" picking up items and your server may have difficulty trying to keep track if the player should be able to pick up the item. Instead, I would recommend using that same "Has Authority" node and use the "Authority" path. You now know the overlap is triggered on the server, and the server can determine what to do and replicate the results by setting whatever values it needs wherever, and you can still use the "Other Actor" pin with a cast to determine the actor that performed the overlap.

sinful tree
quartz iris
#

one test on each screen

sinful tree
#

Not about which screen.... More do you actually see the lines saying "Server" and "Client1"?

#

Or do you only see "Server: test" and it's shown on both screens?

tepid lark
#

You guys see Server and Client desginations in your prints?

oak pond
sinful tree
oak pond
#

yeah but then what

sinful tree
#

Do whatever you need to do with that character reference. You can run RPCs, set values, etc.

oak pond
#

no like

#

the pickup event already does everything I need to

#

but I just need to like

#

well for a start since the actor has to be replicated, this messes it up so I want most of the event to be clientside

#

but clientside to the right client

tepid lark
#

what are you trying to do

oak pond
#

just not replicate the pickup

#

I dont know why it is

sinful tree
tepid lark
#

so you want to pick up the item on the client but the item will still be available for other clients

oak pond
#

yeah, because then Ill do another event which multicasts and does only what needs replicating

quartz iris
#

but wait for every other print text it says this

sinful tree
#

That's what I'm getting at. That's what you should be seeing.

quartz iris
#

oh wait it does

#

It says this on both screens

#

Server: test

#

Sorry

sinful tree
#

Ok good πŸ˜›

tepid lark
#

I don't see that but I'm running in stand alone

sinful tree
#

Standalone you wouldn't.

tepid lark
#

scared me

sinful tree
#

Ok, so move the print string to after the cast when it is valid - just after you're trying to call the event in the gamestate.

oak pond
#

also another thing is destroy actor just seems to not work at all

#

even clientside

#

Ive checked with print string its running the event but nothings happening

#

and then I set up a server to multicast event to do it and still nothing

sinful tree
# oak pond but clientside to the right client

The actor reference on the Overlap, cast to your player character class, check if it is locally controlled, the true path of the branch will only execute on the client that is in control of the actor performing the overlap.

oak pond
#

because a WEAPON PICKUP isnt a CLIENT is it oh god I just dont know how to do anything outside of a player blueprint

oak pond
#

I think I fixed it though but yeah I cant destroy the actor

sinful tree
#

You can't do it locally if it is a replicated actor. You need the server to do it.... But again this is why it's better to be doing it on the server to begin with because now you're going to have to give an avenue for a player to tell the server to destroy a particular actor.

quartz iris
dark edge
oak pond
sinful tree
# quartz iris Yes it does

Ok, so then by that logic, your gamestate event should absolutely be firing, it's something in that event that isn't working, like perhaps the cast you have to the playerstate.

oak pond
quartz iris
#

in player state

dark edge
quartz iris
#

It is

sinful tree
#

It doesn't matter for what you're attempting to do.

oak pond
#

Im keeping as much of it clientside as I can

dark edge
#

Well that there's your problem

sinful tree
dark edge
#

You're basically trying to predict weapon pickups, right?

tepid lark
#

omg. I may have been unpossessing and destroying the actor which is why the overlap sphere was not there on second spawn

sinful tree
oak pond
tepid lark
#

i can hear datura scream internally

quartz iris
dark edge
#

Good luck with that. I would suggest starting with doing it correctly and then later trying to make it responsive instead of the other way around

oak pond
#

wouldnt that be so much worse, it shouldnt all be replicated

sinful tree
quartz iris
#

?

#

shit

oak pond
#

and I STILL dont know how server events work on other actors anyway

quartz iris
#

like this?

oak pond
#

Im sure I could have this working if I did all these scripts on the player instead but I dont want unnecessary mess

tepid lark
sinful tree
# quartz iris

Your gamestate event it is checking if the damage causer is a playerstate, is it not?

dark edge
oak pond
#

but why? the player knows if he has ammo or not, therefore knows if he can fire his gun, then all that needs replicating is the gun being fired

sinful tree
# quartz iris

So you probably want the playerstate of this particular character, which you should be able to do by just doing a "Get Player State" (not the one with an index)

dark edge
sinful tree
quartz iris
oak pond
#

HOW

dark edge
#

My ammo is infinite and I fire 60x per second

quartz iris
#

Because it needs to reference actors and characters

sinful tree
#

It's running on my computer, I can alter it.

oak pond
#

is it just that easy to go and do whatever you want with a game like that

dark edge
#

Yes

sinful tree
#

Yep, if you code it poorly.

oak pond
#

I dont see people doing this even with singleplayer games

sinful tree
#

LOL you see people doing this ALL THE TIME with single player games. That's what most cheat engine/third party cheats are.

dark edge
#

If you're new to multiplayer, do pretty much everything serverside and replicate the minimum state required to make everyone agree on what is happening.

oak pond
#

ngl I dont think I stand a chance replicating my entire weapons and ammo systems that just doesnt sound realistic

quartz iris
#

how do i replace actor with character

#

on the input

dark edge
#

How do you think literally every other game does it

dark edge
quartz iris
#

or can i go from actor to character

oak pond
#

most multiplayer games tend to have multiple people helping to build it

dark edge
oak pond
#

should I just not bother with pvp and have coop modes only

#

I mean even if I put in all the time to getting all of this working Im sure itd just lag too much to play against other players anyway

dark edge
#

I mean I would never even consider doing PVP where the client says that it shot in the server just shrugs and says okay I guess you shot

#

Multiplayer is hard as hell.

#

However hard you think it will be, it will be at least 10 times harder to make an actual game

#

At least with co-op you can get away with more client-side stuff because you can generally trust that your friends aren't cheaters

oak pond
#

yeah and every time I do this I feel like I forget everything I knew because it never seems to work how I did things before

quartz iris
#

Ok its fixed

#

Rookie mistake

#

Could someone show me code of a multiplayer ability that they've got?

quartz iris
dark edge
quartz iris
#

Thanks guys

#

I will credit you all on the game πŸ™‚

dark edge
#

You didn't say it had to be a good ability, just that it had to be an ability. That's kind of the minimum spec of any ability system. Your input does the ability and the fact that you are doing an ability has to get to the server in some way. Beyond that, they are all going to be done in vastly different ways

arctic minnow
#

How important are these settings for my thirdperson character?

tepid lark
#

I'm having a weird issue where the first time a spectator actor spawns in and is possessed, the collision sphere is there and visible. The second time the spectator pawn is spawned and possessed, there is no collision sphere visible and it doesn't generate overlap events.... but it says it exists and has a location. Any ideas

#

as in start spectator, spawn player, player dies, spectator is spawned again and drops a particle system but there is no visible collision sphere to trigger revive events

#

I'm almost to the point of spawning a seperate actor bp and foricing it that way

halcyon totem
#

after I do a seamless travel it does it very fast, how can I make sure my postlogin code gets called? Its not sending my spawns to the correct place after map change

arctic minnow
oak pond
#

so this is why I cant get replication events working on anything other than the player

#

god I hate having to do everything

fossil spoke
#

Be thankful thats all you have to do. Be thankful that UE has a replication system built in at all.

icy jetty
#

imagine doing all of this without a free-to-use open-source engine with hundreds of pre-built functionalities, like they did it in the olden days

tepid lark
#

and would eventually pool together a free-to-use-open-source engine with hundreds of pre-built functionalities

#

then someone would say "god i hate having to do everything"

icy jetty
#

haha took the words right out of my mouth

dusky yarrow
icy jetty
#

I meant more like the source code is open to view

oak pond
#

yeah, Im aware that I do take unreal for granted sometimes, I wonder if it would have even been possible for me to get into game development maybe a decade ago

#

just gets frustrating seeing smart people making smart games all the time lol

icy jetty
arctic minnow
#

How would I replicate this so it would work for server and client?

#

πŸ™‚ πŸ™‚

#

πŸ™‚ πŸ™‚

oak pond
tepid lark
icy jetty
tepid lark
#

and my project is held together via ductape and spite

sinful tree
oak pond
#

oh yeah trust me all my projects are such a mess, seems impossible not to be once it gets to a certain point in development. I can easily see my improvement by looking at past projects though

#

still, not a damn thing properly released though

arctic minnow
#

I tried that but it just leaves the client twitching trying to set the rotation but does not work but it works for the server im in a listen server

#

πŸ™‚ πŸ™‚

#

πŸ™‚ πŸ™‚

#

But if I hover over my screen it works? maybe because of my locomotion and my character movement with my camera or something?

sinful tree
tepid lark
#

omg. so the client's collider just isn't visible on the player host for some reason. and I wasn't aware that collision events would only print on the client so I wasn't looking. If I wasn't like this... I'd probably get things done faster.

arctic minnow
#

πŸ™‚ πŸ™‚

#

πŸ™‚ πŸ™‚

sinful tree
#

._.

limber gyro
#

in testing i found out that players that host the session have way more accurancy than players joining the session, i assume this is caused because the player hosted the server is treated as the server and everything he sees is true while the players that join might be hitting things that in the server are in another place making the hits not register properly. Whats the best solution for this?

dark edge
#

Why is half my screen smiley faces now

graceful flame
graceful flame
#

You asked for the best solution though.

limber gyro
#

that just means hit reg is just going to be bad in all players

graceful flame
#

Because it would resolve the latency advantage problem more or less without having to write any special code.

#

With listen the host has 0ms and others have whatever they have.

#

But at least on dedi they all have some latency depending on how far away they are from the server.

limber gyro
#

there must be another way like making hit reg client authoritative or something

graceful flame
#

Also it’s trivial to cheat on listen but harder to cheat on dedi

#

So unless it’s like a friends only coop type game where cheating isn’t going to matter all that much. Otherwise if it’s competitive you 100% want to go with dedi.

graceful flame
# limber gyro there must be another way like making hit reg client authoritative or something

If you want to see what it’s like to play as a cheating client then setup an input keybind and make it change some important value. Then you can just spam that input button to increase character stamina or health or something. That’s kind of what it’s like for a cheater when you use client authority they can basically make their own keybinds to change values during runtime.

grizzled garnet
#

Is the actor owner a replicated property? I'm having issues having an owning client execute a server side RPC

sinful tree
grizzled garnet
#

so I guess when I call SetOwner to change the owner (in this game the player picks up an item they can interact with) it should be multicast then

arctic minnow
#

Like the code works for players the I am not playing

sinful tree
#

Nevermind, it is a replicated property.

    UPROPERTY(ReplicatedUsing=OnRep_Owner)
    TObjectPtr<AActor> Owner;
#

But again, it doesn't mean that the value will properly be set on all clients as some clients won't have reference to the owner if it's not something that exists on their end.

#

Eg. Getting an owner of a pawn usually results in getting the player controller which only exists on the server and the client that player controller belongs to, no other clients.

grizzled garnet
#

I have an item which gets its owner set when a player picks it up, I set the owner to the actor of the attach point (component)

#

the actor is a pawn controlled by a controller then

sinful tree
grizzled garnet
#

I think my issue could be that the attachment I made to run server side but its also part of an interface which means I'm calling the _Implementation function directly to make the compiler happy so it isn't really actually running server side?

sinful tree
grizzled garnet
#

From the debugger I can see the owner of the item is set to the owned pawn. The item itself tries to call the RPC from within a normal function call

#

(local) player click button, calls function on item -> (interface) item calls replicated function -> (interface, server, this isn't running it seems) item runs server code, spawns new replicated actor

sinful tree
grizzled garnet
#

As far as I can tell nothing in the debug output after runnign PIE

#

Wait in the save log I see some warnings about not replicating properties but I don't think it has to do with the functions in question

#

Seems I didn't replicate the pointer reference in GetLifetimeRepProps to the item for the player, this could be the issue

arctic minnow
#

Are these settings bad??

#

Does anybody have tips for making network smoother? πŸ™‚

grizzled garnet
#

Also make sure to only modify properties on the server (or rarely only on the owning client, never both), if youre having like jumping issues then there could be a conflict between server and client, or worse you're calling a multicast RPC thats getting reflected twice on the client (for example adding a value could get doubled if that value is replicated)

#

@sinful tree alright I got somewhere, it seems the issue was that I wasn't replicating the pointer properly. Client side knew what item to run the function off of but server probably had nullptr, thanks forthe help

#

Wait I might have to take that back...

sinful tree
# arctic minnow

Always Relevant can be bad, depends on the actor. Usually always relevant is reserved for "manager" type objects that all clients need to know about all the time. PlayerState and GameState are examples of actors that are usually always relevant as at any time a player usually needs to know some information about the other players in the game and about the state of the game itself.

#

Putting always relevant on actors like characters or even static actors in the level usually shouldn't be done as then you're always receiving updates for these kinds of actors when you don't need to be like when you're really far away from them.

arctic minnow
#

Thank you sooo much it was on my thirdperson character I turned it off sense any of the info they need to know is already relevent and I use repnotifys thank you sooo much! πŸ™‚

#

πŸ™‚ πŸ™‚

#

πŸ™‚ πŸ™‚

arctic minnow
#

Why does this play for everyone?

#

πŸ™‚ πŸ™‚

pallid gorge
#

Should I check "Use Client Side Level Streaming Volumes" on the Persistence Level? Is it better?

timber frigate
#

I'm making a multiplayer game but I'm considering selling it on steam for free. Should I charge or should it be free to play?

timber frigate
sinful tree
# timber frigate I'm funding this all myself

Then it's something you should be asking yourself. It can be difficult to judge how much your game may be worth, but you've spent time on it, and if you have a following, you may want to capitalize on it and you have to figure out what the value is that people would be willing to pay. Giving it away for free doesn't mean people will necessarily play it. If you're worried that you don't have much of a playerbase, then you can give away keys to popular video game reviewers/websites/youtubers/streamers and they can both increase the number of players and help build up some awareness of your game which could then lead to sales and drive people to your game. You could always try doing a demo/free trial version too which you can lock players out from playing it beyond a certain amount of time or restrict other aspects of the game, and if they want to continue playing they'll need to buy the game.

No one can really tell you to sell it or give it away as there's difficult choices and work to do in both scenarios, and it all depends on your goals and what you hope your game to become.

timber frigate
sinful tree
#

If it costs millions to develop, they're doing something else to make money like microtransactions, and they likely have the marketing to be able to handle getting a large amount of players to be able to support such a game (ie. they can rope in whales that'll dump tons of money on the game). Free to play doesn't translate well with smaller game studios unless they happen to make a huge hit in which case they probably would want to stay with pay-to-play model anyway.

#

Like... Could you imagine how crappy the Among Us developers would feel if they released their silly little multiplayer game for free?

#

MILLIONS of dollars lost.

#

It didn't even do great for the first year or so if I remember correctly, but then streamers all jumped on board and their audiences joined them.

sinful tree
#

I suppose in some ways, free to play titles hit the small studios pretty hard. It's really easy for players to flock to free games, and players can easily justify not playing a similar game on the basis that they'd have to pay for it. What is good about it for little studios though is if they charge to play the game, then they don't have to work in systems that are anti-player to force them into buying from the microtrasaction shops, reducing the "fun" of the game just so they can make some money.

timber frigate
#

Thank u bro, I'm thinking around $5-10 is solid

timber frigate
sinful tree
# timber frigate Does the game have to have continuous updates to continue being successful? Or i...

I wouldn't be able to answer that as you would have to define what "being successful" means. It could be as simple as "The game always has at least 2 matches running that players can drop in to" to "Still selling 5 copies a week" or "There's always been at least 30 players online playing for the last 3 years".

Making updates certainly could help keep players interested especially if you're adding new things to spice up the game some more to break up the monotony of it, and if it's multiplayer and competitive in any way, and does have a good size playerbase, you're going to have players asking for balance changes all the time even if you think it's in a "perfect" state, someone will likely find something that is just downright OP or broken.

rocky kestrel
#

I have player "Sleeper body" blueprint and when it spawns I want to set clothes on like this. For loop inventory and then just "set static mesh and skeletal mesh". This doesn't work on dedicated server but How I could do this with repnotify? When this sleeper spawns and init clothes on I want players that connect after that can see it too.

#

If I do multicast event for set static mesh and call it here doesn't new joined players see it? Only current players on server.

#

This actor is created in ThirdPersonGameMode after OnLogout

formal solar
#

I am getting TOO MANY RECEIVED PACKAGE TO ACK (256) ERROR

#

any tips to reduce bandwidth of blueprint logic?

shy yarrow
#

SEARCH_PRESENCE not be recognized by the UE5.2 version, what can replace that?

quartz iris
#

Following on from yesterday, would you be able to show me how to fix the low health widget, as it shows for the server all the time even if the client is the one with low hp

quartz iris
#

Should I be doing it with an onrep?

graceful flame
#

I think the problem is because owning player on the create widget is empty.

quartz iris
#

Do I put self?

#

Hm it still shows up for both

#

multiplayer is a pain man nothing works properly

graceful flame
quartz iris
#

I don't really understand this at all

#

How would I do this for the local player with onrep?

graceful flame
#

5 and 6

quartz iris
#

lol

#

now it only shows on the client

#

that doesnt help at all

graceful flame
#

Who’s the Owning Player for the widget supposed to be?

#

You’re using dedicated or listen host?

quartz iris
graceful flame
#

Remove the has authority switch because that creates separation between the two and if it’s listen you want both to be capable of showing the widget right? But only the correct player who was damaged at the time shows it.

quartz iris
#

yeah I want the server and clients to show a widget if they're damaged

#

but not on both the client and the server only the respective user

graceful flame
#

This is the character blueprint ya?

quartz iris
#

yea

dark parcel
#

How do we send payload with our own costume variable in Gas?

graceful flame
#

Well then pass in the owning player to the create low health widget

graceful flame
#

Yeah

quartz iris
#

is this not what local player does?

graceful flame
#

Get local player 0,1,2,3…etc is for split screen multiplayer.

quartz iris
graceful flame
#

Hence the name local player. It’s confusing to many people yeah

quartz iris
#

now im stuck on the owning player lol

graceful flame
#

Because it needs a controller I think, I’m just on my phone here without UE running

quartz iris
#

what kind of controller

graceful flame
#

PlayerController

quartz iris
#

it wont connect

graceful flame
#

Make sure to have use context checkmark on when adding nodes so you don’t get all the extra stuff

#

You can get it from the player state I believe which is an inherited variable (once again I’m just on my phone going from memory here lol)

quartz iris
graceful flame
#

So I might be wrong but yeah I think you can get the player controller as a reference you setup earlier or from the player state directly.

#

Use the player state that doesn’t have the Get function its the one that’s just blue already

quartz iris
#

?

graceful flame
#

Otherwise you’re getting player state of player who’s index is 0 in the array of connected players

quartz iris
#

to me this makes no sense

#

why is the local player not just the player who was effected

#

sorry but it makes absolutely 0 sense

graceful flame
#

Because you have to tell ue which player that was

quartz iris
#

why ;D

#

seriously kill me this is too difficult

graceful flame
#

Because you could have it so when damaged some other player shows the widget if you wanted to

quartz iris
#

how am I supposed to know what player it is

graceful flame
#

By studying the documentation, watching videos and lots of trial and error dev testing. I spent like 2 years as an indie dev and I still fumble over this stuff. There’s just a lot going on.

quartz iris
#

On rep player has hp lower than 50 show widget

#

it makes sense for it to work

#

but it shows on the other f'ing player lol

#

even though that player does not have low hp

#

I managed to connect it but it wont work

#

i can almost guarantee

graceful flame
#

Using breakpoints also helps slow things down during testing and lets you visually see the logic of blueprint flow and if it’s running on server or client or not.

quartz iris
#

lol it shows on both the client and server again

#

all I want to do is show a widget for when a players low on hp yet it is so annoying to do and nobody actually knows how to do it properly without it breaking because its so complicated

thin stratus
#

It's probably cause you didn't limit it to the local player

#

Given the OnRep, if not using a condition, will call on every instance, so for a character on all clients that are in relevancy range, if you just do GetWidget in there, it will call for all

quartz iris
#

how can I limit it to the local player?

thin stratus
#

E.g. by checking IsLocallyControlled in your characters health OnRep before accessing the widget

#

Perfect solution would be having a delegate call from the OnRep and listening to that in the Widget, but that is a bit more annoying in BPs, cause you need a quick setup for notifying the Widget when the Player has a valid pawn/character

#

Accessing the widget in the OnRep is somewhat okay, but scales poorly

quartz iris
#

Thank you man

#

So I can use is locally controlled to do anything for only a certain player from the server?

thin stratus
#

IsLocallyControlled simply checks if the instance the code is calling on is local or not. Only works on possessed pawns of course

#

Will only be true for the person controlling the pawn

quartz iris
#

Nice I have a few more problems aha

#

Why does the server know who won but the client doesnt?

quartz iris
quartz iris
thin stratus
#

@quartz iris are you using the PlayerController to indicate the Winner?

thin stratus
#

That doesn't work

quartz iris
#

but im getting the controller from event damage

thin stratus
#

It only exists on server and owning client

quartz iris
#

so I have to convert it?

thin stratus
#

Use the PlayerState

quartz iris
#

from player controller?

thin stratus
#

Yeah

quartz iris
#

ok

thin stratus
#

The PlayerController will be null/invalid on other clients

#

PlayerStates are replicated to everyone

#

Also these are basics that are explained in the compendium

quartz iris
#

oh

#

it was the player character

thin stratus
#

Either way use the PlayerState

quartz iris
#

like this>

#

it still shows nothing on the second screen

thin stratus
#

No

quartz iris
thin stratus
#

You can't have GameWinner be a PlayerController

quartz iris
#

Its not

#

I was just trying to get the steam name

thin stratus
#

You were still getting the PlayerController from GameWinner

#

That is invalid on other clients

#

Just get the Player name from the PlayerState

quartz iris
#

Ok thats fixed

#

Lol

#

One last thing I swear

quartz iris
#

When playing the game with advanced steam sessions installed, it doesn't show i'm playing the steam game anymore

#

This used to happen before I updated the engine to 5.2

#

I doesn't look like it is able to show the steam name or avatar either via playerstate

pliant moss
#

I have an actor with an replicated actor component. The component has various varibles along with an TargetLocation. Any client should be able to set this target location through interacting with the actorcomponent. Once the TargetLocation is set, the actor component will apply force to the physics body of the parent. How would i propperly set this up with replication?

#

Do i need to set the relevant varibles like the FocalPoint to also replicate even tho the component is set to replicate?

quartz iris
#

anyone?

dark edge
#

What is the specific mechanic?

#

You probably want to route the interaction through playercontroller or pawn

pliant moss
# dark edge Only the owner can call a run on server rpv

I have an anti gravity gun that can move objects around. and i do a linetrace inside a gameplay ability and check if the hit actor has a actorComponent(logic in the screenshot). If the component is valid i turn of gravity on the component owner (static mesh) and then i apply force on tick for the object to move towards the FocalPoint set by the the ability

quartz iris
#

Hey

#

My code for creating/joining a server with the Advanced Steam Sessions plugin works in the editor, but when I package the game and play it, it fails to make a server

graceful flame
#

Are you using LAN?

quartz iris
#

I'm not 100% sure what you mean

graceful flame
#

Are you testing using two computers on your home network?

quartz iris
#

I can't even create a server with 1

graceful flame
#

with two different steam accounts?

quartz iris
#

Im going to use other people to test

#

But it won't create a server atm

graceful flame
#

Is your game setup using steam app id 480?

#

aka spacewar

quartz iris
#

yes

#

it even shows spacewar as the game im playing on steam

#

it shows my avatar name etc

graceful flame
#

I think the issue is because everyone uses 480 its hard to find your game session so it fails most of the time. You can test over lan without much difficulty but otherwise you need to register for your own app id with steam.

quartz iris
#

bruh

#

can I not use a different one?

graceful flame
#

yes you are supposed to register for your own app id

#

and pay the $100 or whatever it is

quartz iris
#

it costs tho right

graceful flame
#

and you need your business setup first for valid tax info too

#

it also could be beacuse 480 is region locked

#

It's a well discussed issue on the UE forums I don't know the specifics though

#

could also just be some error or warning in the logs which explains the issue

quartz iris
#

any way to see logs on the packaged game?

graceful flame
#

which build config?

quartz iris
#

?

graceful flame
#

I think it has logs with dev and testing but not shipping

quartz iris
graceful flame
#

not that

#

when you click to package you're given a list of options

quartz iris
#

oh

#

maybe its this

#

did I package it wrong?

graceful flame
#

Not sure why you don't appear to have testing as an option on there, but anything but shipping should have logs in the saved/logs folder

quartz iris
#

man..

#

I got so close to finishing the game

quartz iris
#

Are you sure this is the problem tho?

stable grotto
#

When teleporting a client using Set Actor Location, Server event set actor location is only needed, no need to use Server event -> multicast set actor location or run on client right?

cursive steeple
stable grotto
#

Thanks!

stable grotto
cursive steeple
stable grotto
#

but not sure why the client needs to move for it to appear.

cursive steeple
wicked latch
#

Got a noob question, I have a post process effect which has its intensity tied to the vector length of the players velocity. I'm trying to get it to run client side only, but since the game uses listen servers the host always changes the intensity for everyone even when using run on owning client. I'm still pretty new to networking so I'm confuzzled here lmao. How would I go about doing that? Only getting the change to happen client-side for the host

#

Yep, noob question, figured it out

thin stratus
#

In what actor is that and why do you check the local role like that

#

BeginPlay is kinda too early

#

The pawn might not be possessed at the point

#

OnControlledChanged or OnPossessed are better events

#

Well BeginPlay calls for the Actor. You can have multiple dummies in your level that aren't possessed, they should still call BeginPlay

#

But yeah don't use BeginPlay in Pawns if you need to check for possessed state

#

Yeah that's server only though

#

OnControlledChanged should be server + owning client

#

Simulated Clients probably have no call in BPs. Best guess for them is CPP OnRep_PlayerState maybe

glossy kettle
#

@pallid mesa whats ur netGUID irl?

pallid mesa
#

INDEX_NONE

glossy kettle
#

😟

obtuse field
#

I have FastArray replication system, based on replicated UObjects.

USTRUCT()
struct FEquipmentSlotWrapper : public FFastArraySerializerItem
{
    GENERATED_USTRUCT_BODY()
    // Your data:
    UPROPERTY()
    class UEquipmentSlot* EquipmentSlot;
    
    /** Optional functions you can implement for client side notification of changes to items */
    void PreReplicatedRemove(const struct FItemList& InArraySerializer);
    void PostReplicatedAdd(const struct FItemList& InArraySerializer);
    void PostReplicatedChange(const struct FItemList& InArraySerializer);

//    void PostReplicatedChange(const TArrayView<int32>& ChangedIndices, int32 FinalSize);

    bool operator==(const FEquipmentSlotWrapper& Other) const
    {
        return this->EquipmentSlot == Other.EquipmentSlot;    
    }
};

My problem is that EquipmentSlot is replicated with delay. Array's PostReplicatedChange is already called, but EquipmentSlot still holds old value, and new value is assigned (I suppose) tick later

void PostReplicatedChange(const TArrayView<int32>& ChangedIndices, int32 FinalSize)
arctic minnow
#

What visual studious version should I use for unreal engine 4.27 for source build unreal engine

icy jetty
arctic minnow
#

πŸ™‚ πŸ™‚

hollow eagle
#

The VS version absolutely does matter (the sub-versions usually don't). 4.27 supports VS2019 and VS2022.

near granite
#

I've changed the location of computer where the server runs to other computer after that My computer can't join to server ..Only computer where server runs can join that server...Who knows why?

thin stratus
#

Replicate a Rotator variable and mark it as Initial only?

formal solar
#

I'm having some net lag issues and looking to optimise in terms of reducing what I replicate and how often, but I'm having trouble understanding the Stat net output. I'm getting issues with a very high 'inrate' (20K+ bytes rate - but what is this rate, is it per frame or per second?) which I assume corresponds to information sent from server to client. I'm getting 'too many received packages to ack since last sent packet' error as well, along with 'server move - time stamp expired'

#

Inrate actually goes to 0 often which I assume is the network giving up

pliant moss
#

If im spawning a static building in my game at runtime. Should i do the spawning with mulitcast. or just setting the actor to replicate?

formal solar
#

If it's just once/ a few times, probably doesn't matter

#

With the latter approach you will need to consider stuff like net cull distance
Also if it's genuinely uninteractive+unchanging, set replication rate to like 1

pliant moss
#

thanks

rocky kestrel
#

Hello, I try to create system when player joins MMO server. There is my code, do you see any redflags here? Now this works when server is open I can play with my two different steam accounts. Login, disconnect. When I login I get items, level, etc... what I had when last time I played. If I login with new account I start from zero.

#

Post login

#

Controller

#

spawn character function

#

and check database event

#

Saving database is also function from beginplay timer 2s looping. Gets data from ThirdPersonCharacter and set it to database with correct key(steamID)

quartz iris
#

Hi

#

My friend has this problem where if he downloads my packaged unreal game, it has Ucas files within the folder and doesn't start the game but shows up in task manager.

#

I have no problems with it on my end though, both in the editor and packaged

fossil veldt
#

Secondly - kind of a πŸ€“ point to make since you probably know this already, but what you are using is not really a database, but you do have the right general idea, i’d look into SQL

#

that struct you’re using for player saves is likely going to cause you much pain later if you need to change any of the data structure

#

especially if it’s a bp struct (assuming it is)

#

Also not sure what you class as MMO server and I really don’t wanna dissuade you or anything, but hoping to support anything more than about 100 people on an Unreal server is wishful, It’s sadly not really built for that, but aslong as you’re happy with 100 players ur good to go

rocky kestrel
rough kernel
#

why can tear off be called in blueprint but torn off cannot be implemented in blueprint?

fathom aspen
#

That's like asking why is blueprint so limited in terms of multiplayer

#

Because it is limited

runic plover
#

I have a quick question, I have an actor component on my BP_PlayerState that simulates a replicated Team Component with a repnotify variable Team, in the rep notify function I called an event dispatcher OnTeamChanged, now I want to bind this event so it calls a custom event in my ui widget, on the server player it works but not on the client

chrome quest
#

Is Chaos physics replicated? And, if not, is there a built-in way to make it replicated and deterministic?

Backstory:

I'm making a spaceship building game with kinematic movement. But collisions are not being triggered during movement so the meshes overlap.

I'm hoping to switch back to Chaos with regular physics movement before I delve into complicated collision detection.

chrome quest
#

Or more accurately. Widgets aren't replicated. So a listen server might have them but it doesn't know, or care, if they exist on clients

runic plover
#

Hmm

chrome quest
#

I saw this and I'm wondering if it results in deterministic simulations. Or is #chaos-physics a better channel for this topic?

chrome quest
chilly patio
#

I'm trying to do this thing where I have a client shoot a trace, and if that trace hits an enemy it would decrease their health then multicast to everyone.

#

but for some reason i cant get it (the enemy) to call a run on server function when this happens.

thin stratus
#
  1. Client should not deal damage
  2. Health is a State and should not be multicasted (only the damage effects, like visuals and sound of impact fwiw)
  3. Clients can only perform Server RPCs on Client owned Actors

Result of that is:

  1. Have the Server RPC in the Character or similar.
  2. Perform the line trace on the Server and deal damage there.
  3. Use a Replicated/RepNotify Health Variable instead of the Multicast.
  4. You can use the Multicast to tell Clients to spawn sounds and VFX.

Bonus Point: You can run the Line trace on the local Client in addition to the Server RPC, but only for the visuals, and then filter the visuals in the Multicast for that player so it's not played twice

chilly patio
#

ah so there's no way for like 100% pure client authorative traces, it still has to go through the server?

latent heart
#

Sure there is.

#

It's just a bad idea.

#

Depending on the situation.

oak pond
#

this is why I decided on coop only

latent heart
#

Ideally you'd do whatever it is you're doing on both the server and the client.

chilly patio
#

im doing a pve game btw

#

so im not too worried about cheating, i need it to be responsive

latent heart
#

The client does a sort of predictive "what will the srever do?" kind of thing. Nothing destructive. The server makes stuff happen. But you don't have to do that if you want people to cheat.

#

Depends what kind of multiplayer you have.

#

If it's friends with friends, cheat prevention is absolutely meaningless.

chilly patio
#

its friends with friends

latent heart
#

Then all you need to worry about is sync issues.

chilly patio
#

so with my first question is it possible to have something like i was trying to do, without the trace having to go through the server?

latent heart
#

The only things that need to go through the server are things you want other people to know about.

#

You can do all the traces you want on the client.

#

Just tell the server what you want to do with the trace result.

chilly patio
#

aha i think thats it!

quartz iris
#

Guys my friend has this problem where if he downloads my packaged unreal game, it has Ucas files within the folder and doesn't start the game but shows up in task manager.
I have no problems with it on my end though, both in the editor and packaged

thin stratus
chilly patio
#

KannaSus definitely!

#

thank you all

thin stratus
quartz iris
#

Idk why the game works for me but not them

latent heart
#

Did they have all the prereqs installed?

quartz iris
#

Actually could you download the game and see if it works for you?

quartz iris
latent heart
#

Idk

thin stratus
thin stratus
quartz iris
#

Whats the setting called?

dark parcel
uncut atlas
#

is there a recommended max players for listen (player-hosted) servers? usually co-op games have a max of 4. is 16 too many?

eager oxide
#

So im trying to make kind of a dungeon entrance where if u run against it it opens the dungeon level for only the player who does run against it
the issue is if i do open level it sends them to diff instances and if i do server travel it sends all of them how would i do it only for one and let the other join ?

sinful tree
# eager oxide So im trying to make kind of a dungeon entrance where if u run against it it o...

Unreal by default only runs 1 "world" (ie. level) at a time.
As you've already discovered, Server Travel makes everyone that is connected to the server move to the server's new level, and using Open Level on a client will cause that client to disconnect from the server it is connected to and attempt to open the level or connect to the IP address provided, which indicates that you'd have to have multiple server instances running to facilitate a client being on a different level, which means that the client loses communication with the original server anyway.

There are plugins that can run multiple worlds on a single instance of a server, but they aren't set up for replication, so that means you'd likely have to do a lot of engine reworking if you wanted to try and create a multi-world multiplayer server.

There is one "trick" method you could potentially use if you're doing "dungeons" and that is by placing your dungeon levels underground and ensuring that they don't overlap at all with the above ground world. When your player walks into the entrance, you teleport them to the underground location.

dark edge
eager oxide
#

thx

low phoenix
#

So what's the current status of IRIS?? I have just checked the 5.3 roadmap, but no mention of it. I didn't find anything in the forum either. I was also wondering, if it has some client prediction stuff. The situation seems a bit messy regarding this currently in UE, at least it is not clear to me what the current systems can or can't do and what future stuff is in development, if there is anything in development at all.

rustic nimbus
#

can someone tell me how do i remove that "client 0" and "server" text that keeps popping up?

#

the "server:" text comes when i host the server and the "client 0" text comes when i join the server

low phoenix
rustic nimbus
#

but they only come after i've joined, doesn't that mean there's some built in blueprint somewhere?

#

the prob is, idk where

rustic nimbus
low phoenix
rustic nimbus
#

wdym

#

example?

#

are u asking if it's cpp or blueprints?

#

it's blueprints

low phoenix
#

is it some sample project or template?

sinful tree
rustic nimbus
rustic nimbus
#

uhh, i don't have any blueprint called Player_B_C_1

#

nor PLayerB_C_0

lost inlet
#

what about Player_B

rustic nimbus
#

it's my player blueprint

#

Player_B

lost inlet
#

so it's coming from that

rustic nimbus
#

those are the only blueprints

#

there are no print strings

lost inlet
#

add a breakpoint to UKismetSystemLibrary::PrintString?

#

I still wonder how this is MP related

rustic nimbus
rustic nimbus
lost inlet
#

How is it a server thing? It's just from the PrintString node

#

And this is using the debugger from Rider/VS. You add a breakpoint and when it reaches it, it'll pause execution, so you can actually see where it came from

rustic nimbus
#

thank you

rustic nimbus
rustic nimbus
oak pond
#

or just more accurate in general of course

#

I imagine it should be a little easier than 3d games since these ragdolls are locked to 2d

amber barn
#

hi guys, has anyone used the ability system in a multiplayer game? im having an issue where the ability system (can activate a spell) is working on my client but not the client+server

obtuse field
#

Is there any event that tells me when object is being replicated for the first time? E.g. its created on the server, then its creation is executed on client via replication, and so event is called

chrome bay
#

Depends what kind of object it is

chrome bay
#

There's IInterface_ActorSubobject which adds virtual functions. It's experimental though.

obtuse field
#

Where can I find some info about it? Google seems to not know about it yet

chrome bay
#

Also that article is a little out of date, I would use the replicated subobject list now

#

Doubt you can, just look at source code

obtuse field
#

ok

solar stirrup
#

Been using it for mine

#

paired with FInstancedStruct for items

#

super flexible

lusty aspen
#

is there any examples for a C++ multiplayer game that is done well in unreal engine? i'm picking through the unrealtournament source and i wish there was something better

icy jetty
#

uh, maybe Lyra?

rain condor
#

Yo! I have an inventory and i wanna replicate item drop. Any idea?

graceful flame
lusty aspen
#

it's a fairly simple use case but typing it out could get a little lengthy

#

i can keep it super high level, i promise i'm not looking for spoonfed answers, just need to make sure i'm on the right track

sinful tree
quartz iris
#

Why can the server only do damage?

arctic minnow
#

Does anybody see anything wrong with this?

icy jetty
# arctic minnow Does anybody see anything wrong with this?

That is too vague a question. Only glaringly obvious issue is the spaghetti you have everywhere, making it hard for anyone to understand what they’re looking at, including yourself. I’d recommend you learn how to β€œpromote to variable” and get that variable as needed.

arctic minnow
#

Thanks πŸ™‚

#

πŸ™‚ πŸ™‚

graceful flame
graceful flame
# quartz iris Why can the server only do damage?

Because the server is the authority when it comes to that sort of thing. You don’t need those RPC events you can just go directly from OnComponentHit to Apply Damage and add any sort of checking or filtering in between.

sinful tree
# quartz iris

Apply Damage can only be executed by the server. Additionally, you do not want the client to call to the server on overlaps (they happen on the server as well) so you can usually use a Has Authority and use the Authority path to only execute when it is running on the server. You also don't want to multicast setting variables you only want to set the replicated variables on the server.

sinful tree
# arctic minnow Does anybody see anything wrong with this?

Big glaring issue is calling Run On Server events and feeding in too much information. Clients can technically call RPCs at any time and spoof the data that you're sending, and by the looks of it, you're allowing a client to say how much base damage they can do which you definitely do not want. There's just far too much data you're sending in general. The server should already know most of this stuff without the client having to tell it and the server should likely be figuring out what it should be doing vs. the client doing it all and telling the server.

#

These RPCs are terrible too as you're effectively allowing players to tell the server to play sounds and vfx wherever and whenever they want.

You want to minimize the amount of calls into the server and the data that you send it in such a way that a player can still have it do things, but not so far as allowing the client to be in control of everything. Like.. Shooting would be Input > RPC to Server that player wants to shoot (no additional information needed) > Server checks if player can shoot > Server spawns projectile or does damage or whatever else. Some things don't require you to send it all across the network either - some data can just be static like what sound effect to play based on the weapon the player has equipped or the location of where the sound should be spawned can be figured out by the server based on the player's location.

plucky prawn
#

Ye but if you just let the client accidentally have authority noone will need to make cheats for the game bigbrain

woven basin
#

For binding something like GEngine->OnNetworkFailure() - so I can intercept and act on those, where is the best place to do do the binding?

i.e. in my custom game instance, game mode etc? Everywhere I read says to bind to that function, but I cant see where the "right" place is to do it

proven kayak
#

the game instance already binds to this via HandleNetworkError

#

but yes, if you need the extra info on the original callback, then the game instance is a fine place to put it

#

a subsystem specifically for handing net stuff is what i would do

woven basin
verbal ibex
#

Hi all, not sure if this is the best place to ask this but I am trying to use the chunkdownloader to mount downloaded pak files and getting this log message. Would be really nice to know how I can register mount points for different pak files.

sharp yew
#

does anyone Uses Physics Sub-Stepping with multiplayer games ? when I try my game every thing works fine as long as I am Not joined to a server , when I join to server every thing becomes much faster and the game is no longer frame rate independent (while playing but not joined to server everything is framerate independent ) , I thought may be its because in server Sub-Stepping is NOT supported or may be disabled by default idk , do you have any idea what it might be ? here is my Sub-stepping settings attached below

#

i know my game is framerate independent because I use Command " t.MaxFPS 30 " and "t.MaxFPS 350" to switch fps and the game and every functionality stays the same (as long as Not Joined to a server ) this happens even when run my game as clients in standalone (but not in editor)

sharp yew
#

Hey Please can someone help !

sharp yew
#

@smoky storm I think Its Exactly what I did dude, I Already asked πŸ™‚

sly salmon
#

No need to bump questions either.

#

To answer your question "does anyone Uses Physics Sub-Stepping with multiplayer games ?": not me.

sharp yew
#

hahaha , ok bro. It is Just for clarifying the Question since Enabling Sub-stepping is Fixing the problem but not for multiplayer , anyways I am Sorry for bothering you .

pliant moss
#

does a pawn have built in client-side prediction and server reconciliation or is it only the CharacterMovementComponent that has more advanced logic for providing a smooth experience?

sharp yew
#

@pliant moss I use a Pawn with a StaticMeshComponent as body I move it using mesh->AddForce(direction * force); , and yes i use client-side prediction and server reconciliation to move my pawn around (it works perfect in editor and everything is smooth ) but after building for server or running as standalone it just becomes much faster (however the movement is still accurate but somehow lagy(not much) )

pliant moss
sharp yew
#

yes I do

pliant moss
#

So basicly its the replicated physics that are driving your pawn movment. I have a bit of differnt setup with a regular movement component

sharp yew
#

ohh , but i think its not only about the physics since the camera seems to be faster in Build or standalone while everything is framerate independent in Editor regardless of FPS

pliant moss
candid fog
#

could you potentially have the code getting somehow double executed by poor rpc logic? Maybe you have an rpc sent by the client that is telling the server to add another set of force?

zealous saffron
pliant moss
thin stratus
#

There is a plugin on the Marketplace that might be worth looking into instead

#

@sharp yew Only thing I can tell you is that Physics + Multiplayer Movement (not sure about #chaos-physics ) is a shit show to avoid

pliant moss
#

Okay thanks for the heads up. But i will atleast take a look. Im mostly intressted in if the inputs are beeing replicated or if its the actor position that replicates. and at what frequenzy this is done.

thin stratus
#

It's much saner to fake it via Velocity

thin stratus
#

Server uses that to redo the move and check against the end location the client send

#

Then it either acknowledges or sends a correction

pliant moss
thin stratus
#

Controllers are generally not replicated to simulated clients

#

If you need info of other players you'll want to use the PlayerState

pliant moss
thin stratus
#

The PlayerController is replicated between owning Client and Server

#

Server has all of them, Client only its own

#

On the Server this works, on Clients you will get nullptrs for other player's Controllers

#

Also not sure what you need those events for

#

A ServerRPC to notify that a Player joined?

#

Why not just use PostLogin in the GameMode of your Lobby

#

You are also chaining ServerRPCs which is redundant too

#

I mean

#

I just told you twice that Clients only have access to their own PlayerController

#

Replicating an Array of PlayerControllers makes no sense

#

There will only ever be one valid PlayerController on Client's end, which is their own

#

If you need info about other players you need to use the PlayerState

sharp yew
fiery eagle
#

#instructions guys can one tell me what is the exact size of UE 5.2 source code after installation.

#

i have 250 gb of free space on ssd will this be enough

thin stratus
#

I can tell you that the 5.0 version from my client that is mostly unchanged is at 230GB

#

So my suggestion would be clearing up space

fiery eagle
#

so 300 Gb would be fine i guess

#

just for installation

thin stratus
#

Yeah that could work. Your own project comes on top if that isn't counted in yet

thin stratus
#

What

fiery eagle
#

🀯

thin stratus
#

I'm relatively sure that's wrong

sharp yew
#
  • binaries of course
thin stratus
#

The whole Engine + 2 Projects isn't 640GB for me, so you must be including more than that

#

All in C:\

#

That's the wrong folder

#

I'm at 270GB with Engine + 2 Projects

#

Or 1 project, can't recall

#

Pretty sure you scanned your whole C drive there

sharp yew
#

ahhh , sorry it was all c:/ directory hahaha

fiery eagle
#

Dude you blew my mind i just bought a pricy laptop and i was like i have to buy another ssd for just the engine

thin stratus
#

Do you need the Source Engine?

fiery eagle
#

Yes

thin stratus
#

Welllll

#

I can only really advice peeps to have at least a 1 TB m2 or so

#

On top of the C drive

#

512 also works, but I wouldn't gamble with the chance have needing more

fiery eagle
#

So my laptop is 1 tb in whole will this be enough for a single project with addition of external 1 tb ssd

thin stratus
#

Yeah

#

It's enough, but you might have more stuff on your PC. Marketplace Packs etc.

#

Learning projects

#

And what not

#

Some of this stuff might take another 50+GB

#

It clutters fast

fiery eagle
#

Noted my men thanks for the help brother appricate it very much

thin stratus
#

Yes

#

Where is that code?

#

Buddy

#

That doesn't work

#

You aren't on the Server at that point

#

While JoinSession will ultimately connect and travel to the Server, this is WAY too early

#

The RPC runs on the local Client

#

There is no Server

#

There is also still no reason to even call that RPC cause GameMode::PostLogin should do this for you

#

You aren't even really connected at that point

#

The PlayerController you call that on is still the one from the previous level, I assume MainMenu or so

#

One option would be in the LobbyPlayerController on BeginPlay

#

There you can limit it to SwitchHasAuthority

#

THen you don't need it to be an RPC

#

But yeah, you are creating a lot of tech debt and problems if you fight UE here

#

PostLogin should really be preferred

thin stratus
#

I mean, that's up to your design :p

#

The rules don't change with that

#

Lobby's in MainMenu's like Overwatch, Fortnite, etc. aren't done by joining Game Sessions though

#

They use Beacons (C++)

nocturne quail
#

UObjects are networked by defaults?

nocturne quail
#

so this is not enough to turn that switch on ? IsSupportedForNetworking

nocturne quail
#

Ok

lilac jasper
#
    {
        if (HasAuthority())
        {
            DealDamage(Hit);
        }
        if (ImpactParticles)
        {
            UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), ImpactParticles, Hit.ImpactPoint);
        }
        if (ImpactSound)
        {
            UGameplayStatics::PlaySoundAtLocation(this, ImpactSound, Hit.ImpactPoint);
        }
        Destroy();
    }```

Destroy is not letting those fx spawn at the correct location for the clients. Any idea how can I overcome this problem?
thin stratus
#

Cause Destroy should only be called on the Server then

#

I would also suggest, instead of destroy, to just call SetLifeSpan(3.f) or somilar

#

And having an OnRep Boolean to deactivate the actor in the meantime

#

You can also look into TearOff and TornOff, which allow letting the Client deal with the rest (might not work if you need some data along with it)

lilac jasper
thin stratus
#

Yes

pliant moss
#

I cant use the repNotify or RunOnOwning client in a gameplay ability?

thin stratus
#

Not sure about RPCs, but replication could theoretically work.

#

However I can tell you that I usually have 0 need to do that

#

None of the Abilities I made in the past are replicated

pliant moss
#

Right so i might be aproching this in the wrong way.

I Have a gameplay ability that transitions the 3dperson view into a topdown "builder mode" in this mode i spawn a new pawn and do a camera blend to the new pawn. i then want to bind some inputs (on the client) to move the new pawn around. But the pawn is spawn on the server (its a drone i want other players to see). so how would the client get a reference to the pawn so i can setup the bindings localy?

thin stratus
#

Just do it in the OnControllerChangedEvent function in the Drone Pawn

lilac jasper
pliant moss
#

Yeah well im not doing an repossession since im building this ontop of lyra which doent really support repossesion

thin stratus
thin stratus
#

:P I know why I would never use that as a base

#

Not sure then

#

Maybe set an OnRep variable in that Drone

#

OwningCharacter

#

And when that OnRep calls check if that Owning Character is locally controlled

#

And then do your Input stuff

pliant moss
#

so i would set the owner to be my character when i spawn the drone on the server?

pliant moss
thin stratus
#

Yeah and so many restrictions from assumptions on their end

#

And so much dead code that you aren't actually using

#

And all the bugs they added that you might never find cause it's not your code

pliant moss
#

Yeah im starting to feel that now. spent like 4 days trying to get repossession to work. seams so silly. but it really means rewriteing 30% of the codebase

thin stratus
#

Sure, but repossessing here might have been a lot easier

pliant moss
#

yeah that would just work out of the box

pseudo merlin
#

hi, does anything special have to be done on rep notifies to work on custom structs (c++)?

#

like override == or something?

quartz iris
thin stratus
latent heart
#

As long as you aren't expecting to have a repnotify on individual struct members, but on the struct as a whole instead.

pseudo merlin
#

thanks, I think my issue was needing to flushnetdormancy

thin stratus
#

Holy crap

#

How much latency do you want to have xD

nocturne quail
#

I spawned weapons in the level, all players can pick them up, but if a player pick a weapon and drop it back. That particular weapon can't be picked up by other players

latent heart
#

Probably because it's not added back to your "lootable items" array. Why do you even have that array?!

nocturne quail
#

and on overlapping the item, it is added to the ready pickup array, I print the items of the loot array and that weapon is there

latent heart
#

On the server and all the clients?

nocturne quail
#

even the players can highlight it and see on the ground, but can't pick it

#

only the player who dropped it, can pick it back

hot parcel
#

Hello, can someone help me with Rewinding? I am following this Article: https://vorixo.github.io/devtricks/simple-rewinding/
I have everything working (tho I have not implemented the NetworkEventSubsystem) but my main problem is the Rewinding seems to be very off whenever I enable Network Emulation and I honestly can't figure out why...

The Green Box is where the Client Player hit the Server Player, but the server is seeing it as the White Box...

hot parcel
molten matrix
#

When I enable network emulation (using the "average" profile) to enable a latency between 30-60, it seems like it adds a lot more. If I check the PlayerState->ExactPing, it seems to vary between 300-500. Am I off by 10 here or am I missing something?

dark edge
#

I know some of the ping values are goofy for packing reasons, like 10x etc

molten matrix
#

Hmm. Strange. So is the actual emulated ping value actually 10x or is it the ExactPing that is wrong?

dark edge
#

You'd have to dig around but I'd bet it's either 10x ping packed into an int or 8x ping for binary reasons

#

ExactPing is probably what's wrong

molten matrix
#

Thanks! I'll dig into it. Would you happen to know if that's just an issue with the network emulation or should I expect ExactPing to be wrong in normal multiplayer as well?

thin stratus
#

Ping also depends on FPS fwiw

#

Is your window focused?

pliant moss
#

Is it possible to spawn and controll a pawn using the movement component only localy?. (server and other players wont see or know about it). Seams like the movement component needs a controller to consume the input. and since controllers are owned by the server it all breaks down

thin stratus
#

Probably not if you at the same time have another pawn properly possessed

pliant moss
#

yeah okay. il make a workaround. thanks

molten matrix
# thin stratus Is your window focused?

This is in PIE, and the log message showing the ExactPing is logged when I activate an ability, which requires the window to be in focus, so the numbers should be from when the window is focused

glossy kettle
ocean geyser
#

anyone know what that last one is by chance? any docs for it or do you just use it like you would for any pushed based object and its kinda auto handled?

stable grotto
#

is it possible that sometimes client player character still is possessed by the player controller even when the client is disconnected?

quartz iris
sinful tree
# quartz iris whats wrong 😦

Just wanted to add, there's two ways of checking if a boolean is true when writing code.
One is:
if (boolean == true)
the other is:
if (boolean)

In blueprint, you're doing the first way.

Same with checking if something is false.
if (boolean == false)
vs.
if (!boolean)

stable grotto
sinful tree
#

Even if you didn't program it in such a way for them to do so, you're opening a door allowing a client to call it.

stable grotto
sinful tree
#

Weapon Primary Server is fine as that starts the chain of executing on the server. The problem is the ones at the end are also run on server events. So instead of allowing the client to have one avenue to execute something on the server (Weapon Primary Server) someone with a little knowhow could skip that RPC which also would skip his conditional checks, and directly call "Start Firing Rifle Server"

stable grotto
#

Sorry but isn't the only fault having a multicast event? when everything should run on server to avoid skipping conditions?

#

and it wouldn't matter of those at the end are also ran on server since its already running on server

sinful tree
#

I as a client have control of my computer, its memory, and what data it sends to the server. I can force my computer to make RPCs at will. That means if you mark an event as an RPC, I can potentially call it whenever I want. If you don't mark it as an RPC, then I can't make the server do it.

In the example code, I just pointed out, I could directly call "Start Firing Rifle Server" skipping all his conditional checks that would normally prevent the player from firing the rifle.

#

You want to limit the amount of events that you allow a client to call, and even limit what data that they send to the server to prevent players from being able to exploit vulnerabilities.
For example, you wouldn't want the player sending an RPC to the server indicating to the server that they want to buy an item for 1 gold. You would just have them indicate to the server that they want to buy the item, and the server should already know the price. I wouldn't want then to also have a "Run On Server" event like "Add Item to Inventory" which gets called after I call the buying RPC as then I could just skip paying for the item and add whatever items I want into my inventory.

stable grotto
sinful tree
#

No. Anything marked as "Run On Server" is something that normally allows a client to call it, so long as the client is the owner of the actor/component it is being executed on. If they don't own it, they can't call it on the server.

stable grotto
#

so usually only the run on server event should be to start doing an action and not to process things

#

so instead of him having an event run on server start firing, it should be a normal event or a function even

sinful tree
#

No.... Run On Server means you are allowing a client to ask the server to do something. It can be an action and process anything you need the server to process, and the server would then replicate the results by setting replicated variables, calling client RPCs or multicasts.

And yes, his "Start Firing X Server" events should just be plain old events or functions.

oak pond
#

is there any way at all to replicate Pose Snapshot? I cant see any way thatd work

#

I assume it wouldnt work for what I want anyway, seems to only be a one-off kinda thing? I need to just send across the literal actors pose and replicate that

stable grotto
#

you would only be able to get that rpc if it was run on client or multicasted right?

oak pond
#

can animation poses not be variables in any way

#

do they actually need to reference an existing skeletal mesh in the world

sinful tree
# stable grotto you would only be able to get that rpc if it was run on client or multicasted ri...

Yes. Any event marked as "Run On Server" that exists on a replicated actor or component that is owned by a client means that client can potentially call that Run On Server event at any time through that actor/component. It doesn't matter what your code says or how you structure it or where you may put it in your code. Simply having it exist in your code makes it an avenue for a client to call the event on the server at any time if the client is the owner of the actor/component.

#

A "Run On Server" event placed on a non-client owned actor, like gamestate, doesn't really do anything and the call would fail if it was indeed called from a client as the client doesn't own the actor. You'd get a warning in your log that the RPC coudln't be called.

oak pond
stable grotto
#

I know that these shouldn't be directly ran on server in the first place but just for explanation purposes

sinful tree
# stable grotto So server events like add item to inventory or add experience should be in game ...

Not necessarily. You can have code in whatever class should be handling it. It's fine to have an "Add Item To Inventory" function in an Inventory Component that is owned by a client, but it's not a great idea to have an RPC marked as Run On Server that would allow them to arbitrarily add an item to their inventory. The idea here is, is that you want the server to be in control, so you limit what you allow the client to call.

Same with picking up items - you don't want the client to tell the server they're picking up an item they walked over - the server should be able to detect that the client walked over it itself, and therefore it could add it to the inventory of the player picking it up without the client telling it to do anything.

quartz iris
#

Pls tell me 😭

sinful tree
# quartz iris But whats wrong with the code tho

I already have if you check the image. You're calling a multicast unnecessarily, and you're calling run on server events from within a multicast which is not great, but you also shouldn't necessarily be setting the RPCs at the end as Run On Server anyway as they could allow clients to call them skipping the logic of trying to prevent them from calling them in the first place.

quartz iris
#

I think i'll do it wrong

sinful tree
#

Basics: Input on Client > Run On Server > Server does stuff > Server sets variables, runs multicasts or Run On Client RPCs as needed to replicate/play out results

#

You don't want:
Input on Client > Run On Server > Multicast > All clients sets variables and checks if variables are correct, and call events to shoot wepaons

#

Nor do you want:
Input on Client > Run On Server > Server does stuff to validate the client can execute the event > Run On Server Event that does what you want (if you read the conversation I was having with Miffy it explains why this then allows someone to skip the validation on the previous Run On Server event)

woven bramble
#

Guys, how can we access Steam data?
For example, we clicked the find server button from the main menu and encountered the server list. There are a lot of names and servers here. Some may use involuntary (blasphemy/terror) names. Or it can create more servers than necessary for spam.

As the game publisher, how can I access this list and data to change them?

sinful tree
#

If you're not running the servers yourself, you won't have any control over what others may post for their session information. The best you can do is set up a filter and not display results that you don't want shown or filter what is displayed in your game.

stable grotto
sinful tree
stable grotto
#

oh in that case no delay is needed since it wont get executed past the admin privilege πŸ‘

sinful tree
#

Another good reason to reduce the amount of data a client is allowed to send to the server too so they're not flooding your network with spam RPCs XD

stable grotto
#

oh yes
MaxClientRate=x
MaxInternetClientRate=x
ConfiguredInternetSpeed=x

halcyon totem
#

is it ok to have these yellow "warnings" or will my game crash?

plucky prawn
#

I mean you can definitely ignore them but they tell you useful things,

oak pond
#

right, I know some of you will just immediately tell me not to do this, but feel free to tell me any other way. Ive set up this horrible system to get 100% accurate ragdolls using animations and spamming the bone locations, but the catch is that if I do it too fast, specifically the arms and legs stop working. so I added a delay on it which fixes it but obviously looks horrible and not really acceptable
https://gyazo.com/fc505a39a8e9dd43021f95b133f6e680
https://gyazo.com/665b47838c735378275680931e2eafd5

#

so, any advice here? it seems that just spamming these events to the maps simply just messes it up

#

is there some better way to update the map or something

hollow eagle
# oak pond right, I know some of you will just immediately tell me not to do this, but feel...

Ok, so there are a bunch of things wrong without really looking at the logic going on:
First, if these characters are simulated locally (as opposed to being "static" until new positions are received from the server) then you're going to be writing a very complicated system - keywords being prediction and reconciliation. Naively applying changes from the server despite the clients potentially having simulated past the point in time they're receiving is going to result in all kinds of jitteryness. If you are indeed simulating physics locally and applying data from the server without any sort of reconciliation then I suggest turning on network simulation to the "bad" preset and seeing how much more things break down because it's not going to be pretty.

Second, I really hope these aren't reliable multicasts as you're going to absolutely saturate your bandwidth like this (and potentially even overflow the reliable buffer which will result in a sudden disconnect). Even unreliable multicasts aren't ideal here, this should really be done via normal variable replication so that it isn't constantly sending updates.

Third, doing "naive" updates from the server by simply applying the new transforms will give pretty bad results - if clients aren't doing simulation locally then you'll end up with a delayed, jittery mess. At a minimum you'd need to lerp between positions, but ideally clients are doing their own predictive simulation (which then makes things way more complicated again).

oak pond
#

oh no dont worry the physics is turned off for the other guy

#

entirely just sets its position to each limb through its animation

#

and I havent set the events to reliable

#

and only runs it while ragdoll

hollow eagle
#

Gotcha, so that at least simplifies things a bit. I'd start by looking at interpolating positions then.

#

You want to introduce a bit of a delay to all updates from the server to prevent sudden snapping to new positions.

#

But you need to do so smoothly.

oak pond
#

yeah, Ive been playing with interping a little bit but cant get a nice result with how it currently is

sinful tree
#

Rather than sending an RPC for each bone, why not build up a structure and send all the data at once? Same with the multicast.

oak pond
#

because I had to add the delays

hollow eagle
#

That doesn't really make sense

#

You send transform updates all at once, and then interpolate from the old positions to the new positions. They should be two separate processes

sinful tree
#

This isn't delayed. You're sending an RPC for each bone and all the RPCs will effectively happen on the same frame.

oak pond
#

yeah but even just updating the map with all of the bones at once stopped the arms from working

#

no I did it in chunks

#

oh I didnt show the whole thing

#

yeah its not pretty

hollow eagle
#

When you receive a new update, you store the current positions in an "old" structure and the new positions in a "new" structure. You set a timer for interpolation and every tick interpolate between them. You do not simply delay.
If you receive another update while interpolation is still going, you do the same as above - take whatever the current positions are and store them in the old structure. etc.

#

The arms not working is almost completely irrelevant to this code, that seems like a simple programming error where you're not updating them for some reason or maybe stomping on later results with some other task.

#

Actually, they may be due to the order you're updating things in.

#

Which shouldn't matter if you're setting relative socket positions but I didn't see whether you were

#

Delaying on the sending side is absolutely not the solution here - it will not solve any problems. The interpolation I'm talking about needs to be done on the receiving end, and applying things in the correct order should not be up to an arbitrary delay that won't actually happen in real networking conditions.

sinful tree
# oak pond

This still doesn't address what I'm saying. You're still sending an RPC for each bone. You could very easily make a structure that contains a "name" and a I suppose two transforms and populate an array of this structure with the desired bone -> values and send the array over in one RPC vs. sending each bone and 2 transforms as an individual RPC.

oak pond
#

you mean a struct as in this kinda thing right?

sinful tree
#

Yep

#

FTransforms are 48 bytes. Sending 2 over at once = 96 bytes. You have FName there which are 12bytes regardless of size. So ~108 bytes of data for each bone. 10 bones = ~1.8KB of data. 60 times per second (assuming this being sent on tick) = 108KB/s.

#

I can see why you wanted to chunk it πŸ˜›

oak pond
#

yeah Ill still delay/interpolate it some way regardless

#

luckily theres not a lot else to keep track of especially since most events are turned off while ragdoll

sinful tree
#

Do you use all the data of the transform? like rotation and location and scale?

oak pond
#

no, I only need x and z location, and y rotation, I tried just using the y of the location for the rotation but well I actually do need all 3 rotators because of the gimbal lock thing

#

uh wouldnt this just be doing the same thing

sinful tree
#

So why not create a structure that contains only that data.
that's 3 floats which is only 12 bytes. So 24 bytes per bone. 10 bones = 204 bytes of data. 60 times per second = 12.2KB/s.

oak pond
#

Im just not sure how to use this struct properly

#

even though Ive used these a lot already before its just I cant think how to apply it to this

sinful tree
#

You build up the array in the loop. When loop completed you can send the RPC with the array value.

#

Hopefully you're using a local variable within a function for the "Bones" array so you don't have to keep resetting it πŸ˜›
On the receiving end, you can read what the bone is, and do what you want with the location and rotation.

oak pond
#

oh wow I didnt realise Ive been updating that array on the server. well I did, I just didnt think about doing it before and then sending it across

#

but I also dont know how Id access the array correctly in the anim bp

sinful tree
#

And instead of doing this at 60FPS, you can maybe send it at 15FPS and just interpolate? That would result in a bandwidth use of only ~3KB/s if you used 3 floats and your FName (which even that is still kinda high!)

#

ForEach Bones > You have the Bone Name, you have the location and the rotation

oak pond
#

to be honest I dont even know how to set this here

sinful tree
#

On the receiving end, you loop through the sent bone array and use the bone name and the location/rotation as you need.

#

So still do this, but instead of calling the RPC, you're adding to the "Bones" array and when the loop is completed, you send the RPC with the structure.

oak pond
#

like this?

sinful tree
#

Yea

oak pond
#

but then how am I setting them in the anim bp? cant with just an index

sinful tree
#

Ok, so then when you receive the RPC, you could break the received bones array down into a map if you want to. Loop through the bones array, add to the map your key (bone) and you can use a transform for your value and feed in your vector and rotation.

#

Then you can use the bones as you need them from the map.

oak pond
#

Im lost

sinful tree
oak pond
#

oh, I just did that but isnt that just the same as it was before?

sinful tree
#

No.
Instead of sending individual RPCs for each bone, you're putting it all into one RPC and reducing the amount of data as you're not sending a full transform.

oak pond
#

oh right yeah. but then couldnt I just skip the struct and add to the map, then send the rpc containing the map and just set it?

proven kayak
#

maps dont replicate :)

#

maps are wonderful, but in multiplayer related code, pretend they dont exist

sinful tree
#

It makes me real sad they don't replicate.

oak pond
#

oh wow, I thought itd just work like any variable if you sent it from the clients value

#

also this is where Im at

sinful tree
#

Looking better.

#

Now, does it need to be sent as a multicast?

oak pond
#

I was wondering about that, because I always multicast but it only needs to affect the "non controlled" player. like the other guy you see

#

but I dont know why this isnt working

proven kayak
#

the variable on the server should probably just replicate, and have an OnRep function

sinful tree
#

And if you don't care about it being on the player it's happening on, you can set the replication property to Skip_Owner

oak pond
#

oh Ive never seen that

proven kayak
#

ive done a fair about of multiplayer gameplay programming and Multicasts are my least used tool

oak pond
#

this doesnt work as is though

#

I dont know whats missing

oak pond
sinful tree
#

It's basically saying you can't use the bones output of the event into a node that could set its value by reference.

sinful tree
#

Check your output log. Getting any warnings indicating stuff about network at all?
If you're still sending at 60FPS 12 bones with your structure is going to be ~5.1KB/s of data which may be too much.

oak pond
#

I dont know where Im looking

sinful tree
oak pond
#

is that different to the usual one that comes up with errors

hollow eagle
#

nothing

#

there's no inherent way to tell the server to change a property

#

the best someone can do is change it for their own client

#

there's no such thing as a message about arbitrary properties

#

it's not part of unreal's protocol. There's no client > server message for it.

#

clients can only communicate with the server via RPCs.

oak pond
#

might just make 12 variables manually at this point

hollow eagle
#

I guess it'd be more accurate to say that the server simply won't accept a property replication message from a client (because such a message does exist, it's just server > client only)

#

it might even drop a client for sending a bad message, not sure what the default behavior is. I guess at worst it just does nothing.