#multiplayer

1 messages ยท Page 687 of 1

hexed thunder
#

oh i think i have a different issue so nvm, i didn't realize i think my actor for some reason wasnt spawning in for clients

ocean geyser
#

roger thank you!

fading birch
#

We have a patcher. My script just runs other commands. It could technically be a .bat.

gleaming kite
#

it does a lot more than just build, building is a small part of it. You still need to be able to provide the user a list of the current branches, change based on the input, generate timed links for each user, prompt them to upload to aws. Thats why i was impressed about powershell.

gleaming kite
fading birch
#

Yeah

#

It does a few things for us

#
1. Syncs from our source control (swaps branches depending on build being ran)
2. Packages the client for our desired platform
3. Packages the server for our desired platform
4. Uploads our debug files to our crash report receiver (we use BugSplat)
5. Removes all debug files from the client build
6. Uploads the client files to our Patcher(you can use Steam, PatchKit, etc here)
7. Uploads our server files to our S3 Bucket
8. Restarts all servers which have code to pull from S3 on start which updates them```
#

We also have a pipeline setup for updating our servers we host on GameLift too

gleaming kite
#

Ah thats some cool stuff, my team is still developing so we can get away with automated zip file sending and gamelift uploading but thats real cool

lost inlet
#

for steam, we actually use the upload manifest thing to exclude PDBs

#

as we also upload an "internal only" build which does include the PDBs

winter plover
#

so reliable RPCs always arrive in the same order they were sent right? Does the same apply for unreliable ones?

#

i.e. if some RPCs get dropped, the ones that make it through are still guaranteed to be in the same order?

kindred widget
#

Reliable, yes. Though I have a memory that was only for the same Actor. Unreliable, there is no promised order.

grizzled stirrup
#

I think reliable means it's guaranteed to get there eventually

#

But not necessarily in the right order

kindred widget
#

Not sure. I've never tested personally. I just remember someone talking about it at one point. Pretty sure it was Jambax.

#

It's never been a consideration of mine. ๐Ÿ˜„ I don't think I'd ever rely on RPC order.

grizzled stirrup
#

Yeah me neither

#

@winter plover Unreliable means the RPC may never arrive at all

#

If it's dropped due to high bandwidth

winter plover
#

yes i know that

#

but do the ones that DONT get dropped still arrive in the same order?

grizzled stirrup
#

I don't think you'll ever be able to guarantee order

winter plover
#

so ue4 doesnt buffer them to guarantee order?

grizzled stirrup
#

Since you'd have to hold up loads of current RPCs to wait on old ones which may never arrive if you did want perfect order

winter plover
#

yea i just wanna know for certain

grizzled stirrup
#

Well say RPC 1 gets sent and then RPC 2 and 3 get sent. 2 and 3 arrive but they have to wait for 1, but 1 fails again. Now you have 3 stale RPCs all being called much later than they should have

winter plover
#

so its basically fire and forget, and its up to me to keep track of things?

grizzled stirrup
#

I don't know for sure but I'm assuming that the engine doesn't wait on older RPCs especially unreliable ones

#

I think the RPC executes whenever it arrives, would be surprised if that isn't the case

#
#

ONLY Reliable RPCโ€™s will garauntee order, and ONLY for the same actor. Connections do not matter. Note that they do not neccesarily arrive in order, but they will be processed in order.

#

Sounds like reliable RPCs do guarantee order

#

But not unreliable

chrome bay
#

They actually do, but as they're unreliable it sort of doesn't matter

#

Edited my response there ๐Ÿ™‚

winter plover
#

so how is order guaranteed?

#

does it just drop late packets?

#

or does it make them wait?

hollow eagle
#

For an unreliable rpc it'd just drop any late packets. For a reliable one it'd have to wait.

winter plover
#

aight, that makes alot of sense

hexed thunder
#

How does a replicated variable in actor A of Actor B work? I am just wondering from a performance perspective replicating simple things like strings/int would seem to be more lightweight than a full on actor reference being replicated unless its just replicating an instruction for the client to point to its current reference?

chrome bay
#

Objects are replicated as a Net GUID, which boils down to an integer.

#

There's a complex system behind the scenes that handles the tracking and synchronisation of object references between server and clients.

#

But TL;DR, it's more efficient than any alternative - UE's networking architecture is very mature

hexed thunder
#

that's great to hear ๐Ÿ™‚ thats what i was assuming thanks

fading birch
#

UE also only replicates what has changed. So it's not replicating the entire actor, it only updates the properties that have changed. It does check them all. But that's extremely efficient.

tranquil yoke
#

Hey guys, can some one give me an idea about how many players i can fit per instance into 4 core server, which has 6 instances running,
My server cpu is like 6%, and memory is 6% when there is no client in the server, I was doing some tests, but i am not sure where should i can start off.
and what should be the idle cpu and memory for each client.

Our app is a VR multiplayer.

sinful tree
# tranquil yoke Hey guys, can some one give me an idea about how many players i can fit per inst...

I'm no expert myself, but there's no real means of determining any kind of expectation of number of players for any application for any given hardware as there's too many variables involved, including the coding of your application, the optimizations you've done within it that can allow the engine to manage more players, the potential network traffic and the network that supports it. All you can do is profile, see how well things run with X players, and increase number of players up to a point where performance is still acceptable. If you want to squeeze in more, then you need to either upgrade the hardware or optimize your code more.

#

Eg. A server handling 20 players that don't do very much and only have 1 input that only allows them to increase a integer value displayed on the screen by 1 each time they push a button, isn't the same thing as a server running 20 full characters that move around an open world with meshes and animations and AIs running around where players can attack things etc.

still coral
#

Hey guys what's up ๐Ÿ‘‹
So I have a rather conceptual question: I'm making a multiplayer parkour game rn and I did the logic for the character building up speed by changing the MaxWalkSpeed on Tick. It starts at X and as you continue running, it increases to Y (max value).
I have the feeling that, in terms of replication, this isn't the most elegant solution, given that:

  • The MaxWalkSpeed parameter isn't even replicated
  • Doing this kinda means that the client needs to constantly tell the server to update the MaxWalkSpeed, which apparently is bad for movoement replication and isn't super network efficient.

My question is:

  • Are there ways to make this work more elegantly, or other ways of changing the character's speed other than through MaxWalkSpeed (that can be properly replicated)? ๐Ÿค”
#

I think the best way to do this is to replicate just the movement input of the player (Vector2D) and then the server calculates MaxWalkSpeed from that.
What would be the best way of doing that? ๐Ÿค”

chrome bay
#

If it builds up while you are moving, the best approach would be to deterministically increase the max walk speed during the movement simulation tick, that way it will climb on server and client without any additional networking and be in lockstep with the rest of the sim. Doing it anywhere outside of the simulation tick will break prediction/replay anyway.

#

This would require a custom CMC ofc

still coral
still coral
#

How do I "increase the max walk speed during the movement simulation tick"? ๐Ÿ˜…

chrome bay
#

You need to move it inside some function that is called to calculate movement physics such as phys_walking or somesuch

pulsar roost
#

Can anyone tell me if voiptalker will work with quest2?

#

i'm running dedicated server setup, and would like to use voiptalker on the clients.

eager gulch
#

Hey guys, a though question here...
Does anyone know what might cause the actors SendingRepState to become invalid short after spawning an actor?
It happens on my dedicated server and I've been dealing with this problem for quite a while now without finding out what causes it. It don't happen everytime only in like 1 out of 100 actor spawns.

eager gulch
rocky kestrel
#

I have simple task that I don't know how to solve. When player click e it cast line trace and then call interface function to object it hits. If that object is loot actor it opens widget. When I click button in that widget it destroys that object.

#

This far it's working it open widget

#

But when I call from widget back to object it doesnt destroy it

kindred widget
rocky kestrel
#

And I try to make dedicated server game where server doesnt play

#

@kindred widgetI'm beginner but I tried that and it also works I just try everything. Now I changed it back to client only

#

should widget also have server event when call that interface thing?

kindred widget
#

Client Only Code:
What I would do, is make your code to open the widget client only. No other machine or the server needs to care about that. When you click the button on the widget, that widget can use it's local controller to pass that object through a generic ServerRPC that passes an Object type pointer through.

Server Only Code:
On the Server version of that client's controller, it can call the interface function on it and pass that controller or that controller's character, which can then add the loot to that controller/character which will replicate back on it's own, and call destroy.

rocky kestrel
#

Okay thanks! I try that

blazing sparrow
#

question about switching the view on the PC while the VR player is playing... how Can I manage this without changing the view in the HMD?
I tried using a sceneCapture2D and setting the 'SetSpectatorScreenMode' to Texture, but the screen capture makes the VR Player view choppy.
I tried 'SetViewTargetWithBlend' Setting the new camera to the 2nd ingame camera, but it also switches the HMD view to that camera.
Is there a way to allow the PC viewer to switch between cameras while the VR player plays?

rocky kestrel
#

@kindred widget "local controller to pass that object through a generic ServerRPC that passes an Object type pointer through" What that actually mean? Possible in blueprints?

rocky kestrel
#

In loot chest Bp

#

In widget which is created in that chest actor

#

Now problem is that when play on client actor is never destroyed but when play on server everything works

kindred widget
#

You don't need multicasts. Your only form of networking here should be a ServerRPC called from the pickupbable on the local controller Which means the local controller sends the RPC. Everything else is replicated including destruction.

#

@rocky kestrel Simple Interface.

#

PlayerController

#

PickupActor

#

Player character controls.

#

If this works. All you have to do is change the part I commented to spawn a widget instead, and pass in the pawn, then you can do the same calls in the widget.

#

UserActor in the authoritive version will be the player's Pawn on the server. So you can set inventory stuff that will replicate back as well. Then call destroy and you're done.

rocky kestrel
#

Thank you much!

pure vigil
#

In a multiplayer session, is there any way to prevent additional connections? For example, everyone loaded into a lobby, the game is launched with the people that were connected. Now they're playing but people can still find the session and connect to it.

I'm sure I could have some flag to say the game is started in the gamemode and kick new connections in PostLogin but it would be nicer to not show the session in the first place in session search.

rocky kestrel
#

@kindred widgetIt works thank you!

kindred widget
pure vigil
kindred widget
#

I don't remember where it is, I swear it was GameMode. I could be mistaken, it might not be a default thing. Worst comes to worst, you can just get the server's Session, get it's limit on a player's Login, if GetPlayerState->PlayerArray->Length < Limit, let it go on, else kick. Or some similar event. I think Login would work for that.

#

Wouldn't help for limiting just those five people. But you could add extra parameters there.

pure vigil
gleaming kite
#

Are rep notifies only meant to be used for changing client only things (widgets, gameinstaces, etc) and everything just be handled by setting it on the server?

verbal tendon
gleaming kite
#

I only ask because I am doing a multiplayer car setup and was using repnotifies to show players getting in and out of the seats. Had an issue where the other clients had no idea of the models in the car because i was pointing to reference of the actors and they were hidden.

pure vigil
verbal tendon
#

If your lobby has a "StartTimer" without a predefined amount of players, you just set maxplayers when the lobby gets started ( like 5seconds countdown ). If you have a max nubmer that's predetermined you can set it right after you create the session

#

the cooldown timer is so you dont accidentally let people in that joined before your session changes take effect

#

So you do want the check on PostLogin < Max just in case there's rare stragglers, but otherwise rely on MaxPlayers option

dusk basalt
#

I'm following a tutorial, because I want to start getting into multiplayer, but can someone tell me what the yellow pin means?

#

his pin isn't yellow like that and it looks normal

edit: but mine still works the same way as his, and I doubt this is cosmetic

pearl fog
#

it's an interface

dusk basalt
#

he has his as the message one

#

thanks

gleaming kite
#

Can multiple players posses a pawn? In my case a vehicle.

kindred widget
#

Nope. To do that, you need Pawns as vehicle seats that have input into the vehicle.

gleaming kite
#

My current setup is skeletal meshes on the vehicle pawn, obviously thats not going to work. I heard about socket attachment but the consensus on the forums was to not use it for multiplayer. Is that the only way to do it?

slate patio
#

Im having an issue where when i switch weapons on the client side the original weapons stay attached and the new weapon attaches to the same place.server side works perfectly.

#

Server Client Server Client because its client only issue im thinking it is something that i replicated wrong i can send pics of BP too

gleaming kite
#

Whatโ€™s your setup? Depends on lots of factors

slate patio
#

I use an array to store the weapons this is the beginplay Server spawn of the weapons

#

i figured it could be alot of possibilities ive just been troubleshooting this for about a week . im pretty new to blueprint replication

gleaming kite
#

Any reason your not just swapping the meshes instead of spawning a whole new actor?

slate patio
#

thats only the initial spawn afterwards i do this

#

i use a decrement and increment integer for the swap interaction

gleaming kite
#

Although I wouldnโ€™t recommend it, if you want to spawn new actors youโ€™ll need to destroy them also. Make sure itโ€™s being spawned and destroyed on the server.

slate patio
#

so this spawns new actors everytime i switch the array

#

it looks like my weapon is spawning twice on the client side

gleaming kite
#

So youโ€™re spawning new actors every switch but not destroying them?

slate patio
#

no i only spawn the weapons at begin play

#

this what spawns on begin play i dont know why the clients are getting double the weapons

hallow sand
#

Net Cull Distance Squared - If I want something to stop replicating at more than 5000 unreal units, would I do 25000000?

verbal tendon
#

The weapons spawned should just be visual meshes, spawn them when the weapon is switched into

#

Have the server-side weapon spawned be for 3rd person view, spawn the FPS weapons on a per client basis, local only

#

I mean that is if you dont have to deal with gameplay features like dropping the weapons in the world, being able to pick them up ( this is assuming you're only doing basic FPS stuff )

mental pilot
#

Anyone have an opinion on the simplest way to send a chunk (say < 50k) of binary data from server to client? Ideally without needing a web server in between.

slate patio
slate patio
#

thanks for the help @gleaming kite @verbal tendon i figured it out working now

pure vigil
#

I know PlayerControllers only exist for the client of that PC and the server.. do AI controllers only live on the server?

pure vigil
# pure vigil I know PlayerControllers only exist for the client of that PC and the server.. d...

Answered my own question, yay google "Controllers are non-physical actors that can be attached to a pawn to control its actions. AIControllers manage the artificial intelligence for the pawns they control. In networked games, they only exist on the server." https://docs.unrealengine.com/4.27/en-US/API/Runtime/AIModule/AAIController/

AIController is the base class of controllers for AI-controlled Pawns.

sullen burrow
#

why the player lags/glitches when changing walk speed on multiplayer?

pure vigil
#

Follow up question .. I'm trying to utilize FindPathToLocationSynchronously to draw potential move paths for the player before they choose to move. I am taking the player's cursor location and drawing a path from the character to the cursor location using this FindPathToLocationSynchronously. But if I can't access it on the client, is there any way to get this information? I really should be able to perform the move calculation locally without having to query the server

sullen burrow
#

but how do I replicate it to server?

#

like, do I need to make a new BP class?

#

which will be a server?

pure vigil
sullen burrow
pure vigil
#

But if that doesn't work, have the RPC function call a Multicast function to set the speed.

#

It's messy but I haven't found any other way around it

#

Make sure when you call the RPC that it's done in a place the player owns like their character bp

sullen burrow
#

like this?

#

@pure vigil (sorry for ping)

#

oh wait, I have a better idea

pure vigil
# sullen burrow like this?

Is "Can Run" something that is handled by the server? If so, yeah that's worth a shot. If it doesn't work you should see a similar stuttering like before

sullen burrow
#

it's not handled by the server

#

but can run is true by default

pure vigil
#

Just a heads up, that sounds like something that SHOULD be handled by the server. You don't want clients to be able to make that kind of decision about things they can do. But making sure everything is 100% server authoritative is definitely a rabbit hole

sullen burrow
pure vigil
sullen burrow
#

well, I guess not, because the player is still glitching

sullen burrow
pure vigil
#

From your RunEvent, call another custom event with Multicast. This event will run on all clients and server.

sullen burrow
#

strange, client1 is not glitching when running from client2 perspective

pure vigil
#

You can probably leave the set "IsRunning" on the server function and then just set the run speed in the multicast

#

Hm. That is weird, I would have expected the opposite

sullen burrow
#

thanks

#

I thought replication would be harder

#

but it's not as hard as it seems

#

gotta replicate other variables then

pure vigil
#

It can be simple and it can be complex. Mostly just remember "replication" means it's coming from the server, propagating to clients. If you're going from client to server it's an RPC and needs to be executed in a spot where the client owns the actor. There are several objects that exist on the server and not the client, I always refer to this http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf on page 10, there's a nice diagram showing what exists where

dark edge
#

@sullen burrow multiplayer sprinting is harder than you think. Test with latency.

gleaming kite
#

if i change a replicated component thats a child of the replicated pawn on the server, shouldnt that component be automatically changed on all clients? (Changing the mesh of a skeletal mesh component thats a child to a vehicle pawn on the server and it doesn't seem to be propagating to the clients)

#

i know i could use a multicast but thats just a lazy ducttape solution; a rep notify also doesnt seem right for this, shouldnt it just work?

vagrant grail
#

Somehow when I try to print the Morning Roll Call boolean value after setting it to true, it's true on the server, but when I try to print the values of the struct from the BP_Character, the Morning Roll Call boolean is still at false

gleaming kite
vagrant grail
#

According to this image :

#

It works perfectly, thank you ๐Ÿ˜„ But I still need an explaination on why it needs to be replicated

gleaming kite
#

Yes, the player state is relevant on all clients and the server but the variables still need to be replicated. If you look at the default player state variables, they are all set to replicate.

#

Just because a proxy owns a object doesnโ€™t mean all variables are replicated

gleaming kite
vagrant grail
#

So that means it's the same behaviour for the PlayerController too, even if on the server a variable has changed on the PlayerController doesn't mean the owner of the PlayerController could get the value of that variable if it's not replicated ๐Ÿค” ?

gleaming kite
#

Yep, also gamestates or any shared classes

vagrant grail
#

Thank you so much ๐Ÿ˜„

gleaming kite
#

Of course glad I could help :)

vagrant grail
#

Could someone confirm to me to always use Rep Notify on variables instead of "Replicated" to be sure if new people join the game they get the infos too ? If this is true, then I don't see any reason to ever use "Replicated", could someone explain to me ?
In the context of a multiplayer game

pearl fog
#

RepNotify is when you want a function to be called when the value is received

#

so you use Replicated when you don't need to be informed that the value changed

heady python
vagrant grail
#

Isn't there more than that ? like people joining the game later not receiving the info in the case of Replicated as they were not present at the moment the value changed and the server sent the info the clients.

pearl fog
#

it's impossible

#

when a variable is replicated, it will be replicated, repnotify == replicated but with a function called

#

its repnotify that may have case where its function will not be called because by default it will check if the client's value is the same as the server's and if that's the case it will not call your OnRep function

vagrant grail
#

So using "Replicated" will also make sure if anyone joining the game later will get the infos ?

pearl fog
#

this is overridable in C++ with DOREPLIFETIME_CONDITION_NOTIFY

#

yes

vagrant grail
#

But what could the function of Rep Notify do ?

pearl fog
#

you can do alot of things

#

for example updating UI

#

updating visual, etc

#

like for example you have your repnotify health, when it is updated you can update your UI

vagrant grail
#

but usually the health UI, we use Bindings

pearl fog
#

not really

#

bindings will each frame check the value, it's great for cases when your value is changing alot

#

but ideally you only update your UI elements when needed

vagrant grail
#

oh I see

pearl fog
#

and OnRep is a great way of doing that in a multiplayer game

vagrant grail
#

Then I have been misinformed about the RepNotify

#

people told me people joigning later don't get the info if I use "Replicated"

pearl fog
#

yeah no it's false

#

maybe they were telling you that with Replicated you can't really know when the value is updated tho ^^

heady python
vagrant grail
vagrant grail
pearl fog
#

yep, this replication scheme is very common in a lot of games/game engine

vagrant grail
#

@pearl fog Also 2 other questions I need to be sure about :

  • Is it possible to create a struct and put a boolean in it and when it's checked it opens a submenu to be able to put values in it like for instance (in blueprint) :
HealthRegeneration? : Boolean
  - Amount to regen : Float -- The submenu starts here and only shows if HealthRegeneration? is true
  - Instant regen : Boolean
  • The Player State is accessible from the Server and the Owning Client, but is it normal that variables you put in the player state don't show the right value on the client but it's the right value on the server without replicating it ? I thought as PlayerState is accessible on the Server and the Client that means the variables in the player state are synced without needing replicating those variables.
pearl fog
#

yeah using a repnotify it's totally possible

vagrant grail
#

huh ?

pearl fog
#

and yeah it's normal that's non-replicated variable in the playerstate are not replicated

#

a non-replicated variable will never be sent to clients

vagrant grail
#

interesting

#

but I don't understand the first one, as I'm talking in the editor

pearl fog
#

oh I thought you were talking about replicating your boolean, well in C++ it's possible but in BP I don't know ^^

#

but yeah, Unreal doesn't do any replication if you don't explicitly asks for replication

#

so even if you're on the PlayerState, GameState or any other default replicated objects, you must mark your variables as replicated/repnotify if you need them to be replicated

#

PlayerState/GameState/... functions like classic replicated actors

vagrant grail
#

Is it hard to implement in C++ (as I did a bit of C++ but never Unreal C++) ?

pearl fog
vagrant grail
#

What the name of the thing doing that in C++ so maybe I can type that followed by blueprint in google and maybe someone asked the same question on forums or stuff like that ๐Ÿ™‚

blazing sparrow
#

question about switching the view on the PC (desktop) while the VR player is playing... how Can I manage this without changing the view in the HMD?
I am trying to allow the PC player to join, and help the VR player (multiplayer asymmetrical style)

I tried using a sceneCapture2D and setting the 'SetSpectatorScreenMode' to Texture, but the screen capture makes the VR Player view choppy, although the PC player is fine.

I tried 'SetViewTargetWithBlend' Setting the new camera to the 2nd ingame camera, but it also switches the HMD view to that camera.

Is there a way to allow the PC viewer to switch between cameras while the VR player plays?

peak sentinel
#

Anyone knows about this?

hollow eagle
# peak sentinel Anyone knows about this?

Unreal isn't going to do anything automatically - I don't believe there's any code built in to synchronize sequence players. You can set the playback time of sequencer yourself when the player joins, though.

peak sentinel
#

I remember something about a Replicated checkbox on sequencer

hollow eagle
#

Ah, looks like I'm wrong - they did indeed add some sort of replication in 4.22

#

ALevelSequenceActor::bReplicatePlayback

peak sentinel
#

Alright, hopefully it will work reliably ๐Ÿ™

#

Thanks for checking it out ๐Ÿ™‚

tribal solstice
#

I have a project setup with Steam Online Subsystem that works fine on PC, but on Mac the client cannot find any servers. Any idea why this might be?

gaunt cliff
#

when using seamless travel, can I only allow the game to move from the transition map to the new map after all the network queries have been handled.
for example: after a character is loaded in the world, I execute queries to the backend loading weapons inventory etc.. however it looks ugly when teh character is sitting there naked until the data is loaded
what I want to do is keep the loading screen running on the transition map until all network queries are finished, notify the transition map that they are finished and then finally travel to the new map.
How can I achieve this?

winged badger
#

why pause on travel map? engine isn't really made to stop there

#

you can just do it on destination map, covering with the loading screen

#

and set everything up before world calls BeginPlay

#

@gaunt cliff

#

also, that seems like it could had been loaded before travel even started

#

setting up everything on the start map, and just persisting it through seamless travel

gaunt cliff
#

hummmm

winged badger
#

if you have a lobby, with players setting up, they can RPC everything to the server as they do

#

server stashes the information on the PlayerStates

#

if you have separate PS classes for lobby and game, they can have a common base carrying the setup information

#

and just CopyProperties the data when they are created

#

this is followed by AGameMode::HandleStartingNewPlayer when each player finishes seamless travel

gaunt cliff
#

currently we're using on post login

#

so we should switch to HandleStartingNewPlayer ?

winged badger
#

and there you can just reconnect or reinstantiate everything you need, as this is when the PlayerPawn is spawned, and you already have game controller and a game PS, fully populated with data

#

yes

#

post login happens after they log in

#

which is when they first join the server

#

it does not happen after seamless travel, as there is no reconnecting involved

#

HandleStartingNewPlayer is called from both PostLogin and from HandleSeamlessTravelPlayer

#

Travel map is not treated as a normal level, its just there so engine can release the old World before it starts loading new one

viscid monolith
#

Hi, how can i set different settings for the same actor, so everyone would see him in one way, but he himself will see it different?
What i mean. I have a player as listen-server, and i set every client client-side only animation class for skeletal mesh. But when i do it same way for server, it gets replicated and everyone sees mangled client-side mesh. Im doing game where you can equip different weapon, so clients should see weapon on the screen, that's why i do it.

if (IsLocallyControlled())
{
  GetMesh()->AnimClass = ClientSideAnimClass;
}
kindred widget
#

Usually you don't. You just have two different meshes and use OwnerNoSee, OnlyOwnerSee settings on the mesh component.

amber yew
#

I need to make a replicating grid inventory.
There are a few ways to handle items and containers for me:

  • Make them using UObjects and add replication code, plus force some actor on scene to replicate them on update (pickup, etc.)
  • Make them using AActors

Second approach looks easier for me, but i know that actors weight more and having 600-800 extra actors in world is not a healthy way to go.

Are there any other cons of using actors for that solution other then load on server? Maybe anyone has other ideas on how to approach the problem in the first place.

elder sable
#

Hi, i'm using the ?listen param when i launch my game to use it as a host, but i would like to know how i can have the same behaviour from the game when i create a session for example ?

hallow sand
#

This isn't a fun error to see, lol
[2022.01.16-11.58.54:686][398]LogNetPartialBunch: Error: Attempted to send bunch exceeding max allowed size. BunchSize=76945, MaximumSize=65536

nimble parcelBOT
#

:clock2: againstao#0115 was muted for 5 minutes.

sweet holly
#

So I decided to roll my own networking via some basic Websockets, and I have the WSConnection component living in a GameMode blueprint...

This was working great up until I started trying to debug with 2 clients launched in the editor. Realizing that the gamemode blueprint is shared between both of them, that is problaby not going to make testing easy.

Where do you think it is "safe" to have the WSConnection... I was thinking in the playercontroller? But there might be a better place I'm missing.

kindred widget
#

GameMode shouldn't be shared between any clients? If you're running two separate standalones, there will be two separate GameModes. If you're running any form of other client, they will not have a GameMode at all.

sweet holly
#

Hmmm - I was experiencing some super strange behaviour but I'll look into that again.

For example, if I do a print string in the game mode on play, each client's window shows two messages. Is that they are actually just sharing the same output log?

harsh lintel
#

I'm spawning a replicated projectile on the server without lag/latency simulation, the projectile spawns at the right place, but the issue is that the projectile (an actor with projectile movement component) seems to not spawn from the player's hands, but a bit far from the player, is this due to the replication taking time combined with the velocity of the projectile movement component?

kindred widget
#

It could be that the projectile isn't replicated until after it's first movement is calculated.

harsh lintel
#

hmmm is there a solution to this in case that's the issue?

#

maybe I could enable the projectile movement after replication ๐Ÿค”

rotund onyx
#

What is the best way to handle procedural meshes in multiplayer?
I know I am supposed to basically replicate the instructions to each client, but I dont really know how I should go about doing that. If anyone could push me in the right direction that would be great

amber slate
#

im making a multiplayer game that I plan on releasing on steam, should I pay the steam fee now to be able to get an app id or should i wait until my game is finished

foggy idol
#

is there any benefit in replicating a struct with an array in it

#

over just replicating the array ?

foggy idol
#

then allow each client handle generation locally based on that series

sinful marlin
rotund onyx
tranquil yoke
#

Some has a guide to write a good actor movement replication system, and also for component ?
any doc where i can get the idea will be very helpful.

sinful tree
#

And it's not difficult to update later.

quasi tide
#

So, I have still have been fighting this issue from close to a month ago. Now I haven't been working on it that entire time, but I have tried off and on. I haven't the faintest idea on what is actually happening. I've tested in PIE, with separate processes, separate instances, and over the net. The issue persists. Server, the orientation is fine, client's, their weapons are rotated to the side. I am setting the WorldRotation in the OnConstruction method. It appears to be getting called twice on the client. I have also tried using PostNetInit - same issue persists.

So I have admitted defeat and have just rotated the mesh to face +Y by default from the Skeletal/Static mesh windows and reimported. @meager spade @chrome bay (Sorry for a fairly delayed ping)

foggy idol
#

but i'd make the vectors a rep notify and use it as initial only

#

or just regular rep notify if the mesh can change later

#

the event would be called from the rep notify function

rotund onyx
#

will repnotify be called on a player's client when they join?

foggy idol
#

Its called whenever there is a difference between clients and the server

#

so yes

#

if the inital state of the array is empty and the server changes that

#

any clients that join and any that already exist will receive the rep notify

rotund onyx
#

oh that's great news, I didn't realize they worked that automatically

#

I had already done the repnotify but thought I needed to set more up before testing

#

sounds like it could work as is

foggy idol
#

great

hoary spoke
#

how would I make a system similar to Fall guys which will only let a certain amount of players pass through a level when they cross the finish line

#

not exactly a coder so I was wondering

worthy eagle
#

Has anyone ever had an issue when weren't getting replicated all of a sudden on the server and the client? It appears to only ever happen when I add a specific GAS ability to one of my characters. Although when I make the same ability in the Tranek sample it appears to work fine. So I am thinking that it must be something with the way the multiplayer is set up that is different from mine and his. This is the ability that is causing the issue, this is what the server and client see when that ability is added, and than this is what they see when its removed.

somber glade
#

is there a standard way to have the server wait for a graphical event to run on a client? For example:
User enters a teleport ring
Camera fade plays on the client
When the camera fade is complete then the server teleports the actor

should I just create an RPC when the Timeline is finished to complete the teleport or should I run the timeline on the server and simply send the fade amount to the client and carry on with the logic with the timeline is done.

worthy eagle
kindred widget
# somber glade is there a standard way to have the server wait for a graphical event to run on ...

Personally. I would have the player's HUD set up for this. Pawn can do the interaction, server can start a timer on the pawn's controller. An RPC should be sent back to client to tell it that it's being phased and pass ServerTime + TimerDuration for the timer ending point. Now back on the local controller you can get the player's HUD, and have it put up a full screen widget, maybe hide the normal widgets on screen, and pass that float from the rpc to the widget for end time. The widget itself can interpolate the best it can to match the time the server wanted to teleport. You can use GetGameState->GetServerTime to help widget interpolate. If you time it so that the widget is fully opaque at TeleportTime-0.25 seconds, it should hide the teleport completely. So networking wise, a single Reliable ServerRPC to use the teleporter, and then a single Reliable ClientRPC telling client when it'll teleport.

kindred widget
#

Camera fade should be able to manage the same.

somber glade
#

We're not particularly concerned about 'cheating' since this isn't really a game we're making, but would it make sense to run the timer on the client's controller if we were? Wouldn't you want the server to control the timer?

kindred widget
#

Server would control the timer. Server version of the client's controller.

somber glade
#

Ah okay. I wasn't sure if that's what you mean or not. Yeah, that's fairly straightforward then.

kindred widget
#

If you don't care about cheating, then you could just do it all locally for the fade, then call the teleport RPC after fade complete. Just really depends. But the effects should definitely be local. Server should at most send the end time like I mentioned and client can interpolate to it, but sending back constant timer updates from server isn't necessary.

dusty bloom
#

Can anyone tell me how i can make an FUniqueNetId from a string?

chrome bay
#

Well, strictly speaking you can't really. FUniqueNetId's have different underlying types depending on what OSS you're using.

#

So it's up to the OSS to "create" one in the correct fashion, then expose it for the rest of the engine to look at.

#

If the OSS has an implementation of the IOnlineIdentityInterface though, you can use CreateUniquePlayerId() which takes a string argument.

#

Most of them should have that interface

#

So actually I guess you can :D, but the OSS is what needs to handle creating it

dusty bloom
#

: D

twin juniper
#

Hi @chrome bay (sry for the ping), i was wondering if u using Single Fire/Semi Auto/Burst Fire all in the same class with HLL or if you have subclasses, actually i'm implementing your "better burst counters" logic to handle semi-auto more easily but got some difficulties to make it match with the original shootergame fire logic

chrome bay
#

all same class yeah, following same logic for the most part

#

ShooterGame weapons are not good tbh. Better off writing your own.

#

apart from anything it's like 3 reliable RPC's at once just to fire a shot

twin juniper
chrome bay
#

shooter game only really has auto weapons, it doesn't do anything else AFAIK

twin juniper
#

do u have any advice on how can i handle that in just one logic ?

#

i'm kinda lost with that since my logic is based off shooter game weapons

chrome bay
#

nothing specific really, for semi-auto you just don't fire the weapon unless the input has been released between shots

#

We're based on ShooterGame but it's not even remotely reminiscent of it now tbh

twin juniper
#

Okay, thanks for those precious informations ! ๐Ÿ˜„

#

Also, on your blog, the videos aren't working (at the end of the article)

chrome bay
#

Ah yeah, I never got around to putting them up ๐Ÿ˜„

twin juniper
#

Oh i forgot, when do you stop fx for semi auto ?

chrome bay
#

We don't, they just don't loop

twin juniper
#

so u play it one time ?

#

i might do that, the one from shooter game is a looped one ๐Ÿ˜

twin juniper
chrome bay
#

So you fire, the fire simulation is triggered. For automatic weapons this process re-uses existing particles and audio components, for semi-auto weapons it just uses a single non-looping effect.

twin juniper
#

i was using the AC/MuzzlePSC from automatic weapons ๐Ÿ˜ might be why it wasn't working on semi..

#

thx for ur help jambax ๐Ÿ™

chrome bay
#

If it was me, I honestly would scrap shooter game altogether and do your own logic from the ground up. The shooter weapons are good to pull ideas from but not a good basis IMO.

#

The more you modify them to add new logic the more you end up hacking it together

twin juniper
meager spade
#

@chrome bay do you have chargeable weapons in your game?

chrome bay
#

not in HLL but I do in the tank game!

meager spade
#

yeah i am currently working on making my weapons better

#

i have 4 different "trigger" types

#

Press, Automatic, Release, PressAndRelease

#

idea is Press and Release is for chargeable weapons

#

Press -> Start charge, Release -> Fire

#

but then again that could be done with just Release..

#

anyway the main question is, how to handle states

#

do i go Enum or go Uobject states..

chrome bay
#

Gameplay Tags ๐Ÿ˜„

meager spade
#

GameplayTags with states is a bit urgh

chrome bay
#

tbh I'm not too sure I like my weap system in that game yet.. it creates a state object and assigns a tag to it

#

yeah

meager spade
#

especially when using switch, etc

chrome bay
#

I don't have trigger types as such, I just have press and release events for the trigger, and then to assist with AI the AI has a "rate weapon for release to fire" utility

#

Since for some weapons they might charge up, or others might be that you have to hold trigger to lock on etc, then release to fire

#

HLL only has auto and semi-auto really in terms of trigger but they operate pretty much the same way

meager spade
#

yeah, i mean i only really have Semi Auto (Press), Automatic, Release (Charge)

chrome bay
#

although on yet another project I had this setup.. which sounds similar to what you have:

enum class EAbilityUseMode : uint8
{
    // Tries to 'Activate' the ability when key is pressed.
    AUM_Default                UMETA(DisplayName = "Default"),
    // Charges the ability while the activate key is pressed. Tries activation on release.
    AUM_ChargeAndRelease    UMETA(DisplayName = "Charge & Release"),
    // Ability is active while the activate key is pressed.
    AUM_Hold                UMETA(DisplayName = "Hold"),
};```
#

This was all predating GAS though :/

#

managed to get a lot of mileage out of that though

meager spade
#

i don't do weapon logic in gas

#

abilities are activated via the weapon code

#

just for the actual "Firing" data (hitscan/spawning projectile)

chrome bay
#

yeah makes sense

pastel current
#

Hello i've got few question about dedicated server programming, first, how to host a map on server side but not on client (avoid reverse engineering the map) and how to split client / server code for avoid client to create dedicated server

twin juniper
#

like snipers ?

bitter oriole
#

Well "can't" and "the engine does it already"

chrome bay
pastel current
#

'kay

verbal tendon
# pastel current 'kay

To clarify on (B) it's really not worth the effort to do that, it's a pretty pointless exercise imo. Unless you are embedding some sort of passwords in your code, and then I would say. Those clear text passwords shouldn't be living in your codebase in the first place, but rather a config file that's loaded, and that file would only exist on the server.

silent valley
#

You can do if you're paranoid that someone will disassemble it and figure out how you've implemented it. I wouldn't bother personally.

#

You're planning on hosting your own dedicated servers and not allowing 3rd party hosting?

verbal tendon
#

As I mentioned in my message above. I do not believe anything should be guarded by the UE_Server macro for security reasons. If you think you have to do that you need to go back to the drawing board.

bitter oriole
#

In other words security through obscurity sucks

meager spade
#

i use it for compiling out code i don't want clients to see

#

like my anti cheat stuff

#

(server side checks)

verbal tendon
#

By the time someone's at a point where they're comfortably writing server side security checks for their competitive PvP game. They wouldn't be asking the questions that they have

chrome bay
#

Wrapping a server RPC with it won't really achieve anything. Clients calling RPC's and the server not verifying what the client is asking at any given time is the root of most cheats.

#

Anytime a server RPC executes something, just validate what the client is asking of it

chrome bay
#

E.g, you want to sprint - you don't check stamina client side and tell the server "start sprinting"

#

You check it at both ends

verbal tendon
chrome bay
#

Depends

#

what happens when you want to add competitive later?

#

It's not just for competitive purposes, it's also about validation - e.g, what the if the client is asking the server to get into a state that shouldn't even be possible.

meager spade
#

even on non competitve games, you need some kind of way for the server to say, yes that's valid (else they can be desyncs)

chrome bay
#

That's very likely, even in non-competitive

verbal tendon
#

I mean yes you have some sort of checks for gamestate validity that are normal

#

My point being that there shouldn't be an abundance of checks in the name of security that someone less experienced ( and paranoid about this potential issue ) may add

chrome bay
#

But yeah generally how hard you go in the paint for anti-cheat depends on the target audience of the game

#

(and UE_SERVER probs won't help there much generally)

meager spade
#

UE_SERVER is literally for hiding sensitive code client should not see

#

like i wrap it for the verification of client shots

chrome bay
#

yeah same here really

#

also compiling out cosmetic stuff etc..

#

not super important tho

amber slate
#

if i use the steam online subsystem, will people need to forward the port in order to host?

#

if yes how can i make it so they don't have to?

meager spade
#

if you use Steam then steam handles nat punch through

#

so forwarding should not need to be done

amber slate
#

ok bc on the tutorial i follow it asks to forward the ports

#

do you mind if i send you the video?

winged badger
#

tutorial is either bad or obsolete then

#

or both

amber slate
#

https://discord.gg/W5g6pZXfjh
: ATTENTION!!!!!!!!!!: At 1:06 we need to also change DefaultPlatformService=NULL to DefaultPlatformService=Steam at line 43 in our DefaultEngine.ini.

In this video we alter our code a bit and change our .ini settings in order to use the steam subsystem. Once we get it setup we then test the game on 2 separate comp...

โ–ถ Play video
#

im following this one

#

it's from 2020

#

so it's not that old

amber slate
winged badger
#

no

#

cedric had some short blog that covered the basics

#

i think

amber slate
#

did you look at the video i sent

winged badger
#

ofc not

amber slate
#

is it obsolete?

#

ok

#

how would i know if it's obsolete?

winged badger
#

it asks you to port forward?

amber slate
#

ok so i need to find one that's updated

#

but this one is the only good one i found

verbal tendon
#

Chill. It's an assumption. When you ask things on Discord, we never have all of the context that you do. Therefore any answer makes reasonable general assumptions based on the information that you have and haven't provided

#

And you as the person asking the question aren't the only target audience, but anyone else reading the question as well as the answer is too, and those people might not even participate in chat. So that's also something that I keep in mind when helping out, because those people make their own assumptions based on the information that they see.

chilly arrow
#

Could anyone link a good set of videos or articles explaining how multiplayer works with unreal engine? Specifically looking for how gamemode, gameinstance, etc. work in the engine for multiplayer and how you would setup rules for multiplayer games. Just @ me please. Thanks

chrome bay
#

@chilly arrow Look at pins in this channel

amber slate
#

is SteamWorks and steam online subsystem the same thing?

verbal tendon
amber slate
#

Ok but Iโ€™m terms of feature

#

Are they similar

verbal tendon
#

They are not the same thing. Steamworks deals with all kind of things around Steam. The online subsystem allows your UE game to play MP together through Steam

amber slate
#

Ok so if I want to make a lobby through steam how would I do it

lost inlet
#

though that's still a poor explanation of OSS

#

online subsystems abstract multiple online services through a common set of interfaces, underneath the steam OSS wraps the steamworks SDK - just look at the source

#

so an xbox, playstation, or mobile version can use the same API just targeting a different underlying service

gaunt cliff
#

when loading a new map, the ground is shown for a second before the pawn is spawned, where in the lifecycle can I intercept that and show a loading screen before it happens ?

kindred widget
#

Usually you put up loading screens before map load. Then stuff like HUD beginplay removes them.

ocean geyser
blazing spruce
#

Hey, ive got a health bar which when either client or server takes damage the health bar updates for both of them, but its just the health bar not the actual health, how can i replicate it so the health bar shows correct values for each player?

#

This is the healthbar's bp

#

This is damage in the character bp

mild lynx
#

How do you add a Blueprint Component to one person in Multiplayer?

#

Kind of like a pickup ability. Usually this just crashes the client for me, but the Host can do it.

twin juniper
mild lynx
#

I've tried this a few time but failed. Not exactly sure how to get the server to create the component.

meager spade
#

@twin juniper your muzzle flashes should be timed such that they dont cause issues like that

#

seems like a VFX issue

twin juniper
#

What is the common duration of a muzzle flash ?

#

๐Ÿค”

meager spade
#

mine are about .1 to .3

twin juniper
meager spade
#

my rifles are about .15 in durations

#

for the flash

#

in real life muzzle flash is pretty quick

#

like blink, you miss it

twin juniper
meager spade
#

the MF duration

twin juniper
#

So u got different MF per weapon

meager spade
#

i have a few different MF's yes

#

my weapons are done via SPM

#

SPS*

twin juniper
#

Wait, can we set duration of a particle at runtime ?? ๐Ÿค” (Iโ€™ve 0 knowledge with the VFX side of UE)

meager spade
#

you can adjust the particle play rate

twin juniper
#

So I can adjust it with weapon fire rate

meager spade
#

i am sure

#

though i don't do that

twin juniper
meager spade
#

Shots per second

twin juniper
#

Yeah my weapons are based on the shooter game ones

#

So I guess itโ€™s SPS too ?

meager spade
#

think thats RPM?

verbal tendon
twin juniper
tranquil yoke
#

Is there any way to minimize or compress the strings that i need to replicate , because i have huge strings that i need to replicate.

twin juniper
verbal tendon
twin juniper
meager spade
#

depends what i set them too

#

every gun is different

twin juniper
tranquil yoke
#

@twin juniper information related to Actors... actors descriptions bunch of stuff, these strings contains necessary information to construct a Actor.

meager spade
#

it can be yes

#

ah shooter game has time between shots

twin juniper
#

I was assuming u too x)

meager spade
#

i have SPS, so in my datatable i have like 6.5

twin juniper
meager spade
#

ends up .15 between shots

twin juniper
#

Okk

#

Is there any advantages to have SPS ?

#

Or itโ€™s just preferences

meager spade
#

nah, just design choice

#

on the user front end, i can display how many shots per second the gun is

#

with the damage, etc

twin juniper
#

And I guess it also applies to shotgun reload

#

Between shot

charred crane
#

I have an actor A that spawns an actor B on the server. Actor B is set to replicate, has a reference to A and calls a multicast rpc that tells A to play a montage. The montage is not replicating. Any ideas? For this specific actor A, I did switch out it's skeletal mesh and anim instance class with a multicast rpc (which is working).

twin juniper
mild lynx
charred crane
#

More info - if i move the play anim call to actor A but call it on actor B, it does replicate. so maybe the problem is that my actor B is somehow not replicating despite replicates being checked?

#

the solution was that the actor B was not net relevant(probably because I spawn it at 0,0,0 due to not needing its position to be valid). I resolved it by making the object Always Relevant. I'm going to try using Net Use Owner Relevancy because I don't like the Always Relevant solution.

toxic lion
#

Otherwise, are you not able to construct object from class, and then attach the component to the actor?

mild lynx
toxic lion
hallow sand
#

Can anyone recommend the best way to debug / profile what appears to be client/server networking issues? Just in general where I should be looking / checking.

silent valley
#

Otherwise, just the usual debug stuff: logging, breakpoints, disable run in process, etc

chrome bay
elder kindle
#

Is it possible to predictively add items to an array that replicates? Doing so currently would result in an inconsistency between the server and client if the client goes through with the add but the server rejects it, at least until the next replication update. I'm trying to figure out a way to force a replication of the array (even though that array hasn't changed) when then client adds an item predictively, but the server doesn't. I tried using Fast TArray replication inspired by this earlier message: #multiplayer message, but calling DirtyArray from the server after the server rejected an item add doesn't result in the removal of that element added predictively client side. Any help would be amazing and appreciated.

chrome bay
#

Certainly possible, but you have to handle the reconciliation yourself. I.E, the client needs to track what it has predicted, and remove it if the server didn't add it for whatever reason.

elder kindle
#

I see, that makes sense

chrome bay
#

Also, the server would have to know the client predicted something, so that it could notify it if the prediction was incorrect.

#

Unless somehow the client is able to work that out for itself.

#

Can look at how prediction works in GAS

elder kindle
#

Yeah that sounds a lot like GAS prediction or movement prediction stuff

#

Ok thank you very much!

chrome bay
#

There's a huge comment in GameplayPrediction.h that explains how Epic approach it

chrome bay
#

A clients' relevancy position comes from their view target usually.

#

Which by default is their own pawn

#

What the server is looking at shouldn't matter

#

Try debugging APlayerController::GetPlayerViewPoint() to see what each clients relevancy position actually is

twin juniper
chrome bay
#

yeah

twin juniper
#

So what if semi auto TimeBetweenShots is like 0.2s and the muzzle duration 0.5

#

If Iโ€™m spamming the fire input the muzzle will have no time to disappear between shot

#

I know itโ€™s not a problem on auto weapons but on semi auto it just looks weird

chrome bay
#

you just spawn a new particle each time, or have a pool of them to reuse

#

or drive it through events so you can keep the same component and just create new particles

twin juniper
chrome bay
#

This is really more of a FX question really, you just make it fade away quicker if it's too much

#

and limit the maximum possible fire rate if you have to

twin juniper
#

How long is your muzzle duration ? ๐Ÿค”

#

I mean 0.1 could be sufficient ?

chrome bay
#

Well it depends, theres flashes, residual smoke etc.

twin juniper
chrome bay
#

It can be as long as it likes, you just spawn a new one each time

twin juniper
#

Iโ€™ll try to adjust that when Iโ€™m on my computer then

twin juniper
#

Itโ€™s not a ยซย reloadย ยป but idk the proper name lol

#

Like with a Kar98

chrome bay
#

there's an additional "bolt cycle" state

twin juniper
#

With a timer etc ?

chrome bay
#

Like I said, the ShooterGame weapons are extremely basic

#

well more to it than that

twin juniper
#

Is this something there is in UT ?

#

So I can maybe look at it to have a ยซย goodย ยป example

chrome bay
#

Most UT weapons don't even have reload

#

let alone any complex interaction

#

I don't know of any examples tbh

twin juniper
#

Yeah Iโ€™ll do that alone then

chrome bay
#

UT is a very one-dimensional project too

twin juniper
#

:/

chrome bay
#

Good source of inspiration for some things but not much IMO

twin juniper
#

Itโ€™s outdated now (same for ShooterGame)

chrome bay
#

The projectile prediction is wacky, weapons and characters are closely coupled together. Just don't like the approach much, but their only goal was to "make UT", rather than a template or base project, so it's understandable.

twin juniper
#

Yeah I guess they didnโ€™t even achieved that (make ut) since the repo hasnโ€™t got updates since years

#

But anyway thanks for ur help again !

meager spade
#

@twin juniper they all shifted to Fortnite

#

hence why UT died

twin juniper
#

(Never gonna happen)

#

Still I wonder if a gas sample is planned

twin juniper
#

We are in #multiplayer obviously Iโ€™m talking about a MP sample

#

And with good concepts

#

The ones in action rpg are very poorly done. (Like the way of giving startup abilities etc.)

meager spade
#

Epic said there will be a new sample with UE5

#

with GAS and multiplayer (i already have seen some of the stuff, looks interesting)

meager spade
#

yes

twin juniper
#

Is this oriented shooter or rpg ? ๐Ÿค”

meager spade
#

shooter

twin juniper
meager spade
#

maybe... ๐Ÿคท

grave notch
#

I read about prediction in multiplayer and it seems like very hard topic, especially for projectiles. In theory how hard would it be to make prediction system for PvE game (multiplayer for coop), so it doesnt need to be very high quality prediction, client actions should have high priority (for hits and for dodge enemies abilities), something like in diablo 3?
So goals are:

  • all players can see enemies actions (dont need to be accurately synchronized)
  • other players can see your actions (accurate sync is also not important)
  • you can see your own actions and its effects instantly (for example projectiles that deal damage to enemies, you should instantly see projectile, hit and damage)
  • if you dodge enemies abilities on your screen, it should be considered as dodge, even if its different on server and other players screen
  • should be protected from easy cheating (still need to validate players actions somehow)
  • easy to make/good optimization (i guess the better synchronization the more heavy it will be for server?)

So would this system be much easier to make, instead of system with good synchronization across all players, or its still will be similar?

winged badger
#

you'll probably find the format more digestable

random nymph
#

What exactly happens when pointer is sent from server to client as a parameter in rpc function?

winged badger
#

it gets converted into NetGUID

#

if client has that actor in its NetGUID mappings (actor is net addressable) it can resolve it into a pointer to its own instance of that Actor

#

doesn't have to be Actor, net addressable UObject

random nymph
#

Lets say I have a DataAsset that the server sends to many clients. Do each client then point into their local instance and they can do whatever to that instance without affecting others?

winged badger
#

they can, and should not

finite goblet
#

is player state preserved in a seamless travel?

winged badger
#

not in the case of DataAssets

winged badger
random nymph
#

Or if server sends it to same client many times then that one client always addresses the same dataasset with each call?

winged badger
#

it is preserved, but is likely to be reinstantiated, especially if lobby/game class is not the same

#

thats what CopyProperties function is for

winged badger
#

any repeat sending of that asset reference will be just the much lighter NetGUID

#

data assets should not be changed at runtime though

finite goblet
winged badger
#

HandleSeamlessTravelPlayer

#

will reinstantiate PC and PS if needed

#

in the GameMode

#

so you can put a breakpoint in there and follow the execution

random nymph
finite goblet
#

Has science advanced far enough to simulate seamless travel in editor?

winged badger
#

no

verbal tendon
#

I don't think it ever will ๐Ÿ‡ซ

kindred widget
#

It has. But it doesn't make nukes, so screw spending money on it.

mild lynx
#

I'm trying to get a Component to be added to a Player Actor to replicate, but this doesn't work. Anything I'm doing wrong?

errant hamlet
#

A bit of a vague question, but does anyone know if Control Rig is properly replicated?

#

I've been looking through the documentation but I'm not seeing anything about this.

thin stratus
#

Pretty sure you don't replicate control rig but just the variables that drive it

#

Same as with the normal anim bp

amber fiber
#

Hey got a question I got a projectile which is colliding against a wall the second it gets spawned. But Only when playing "AS Client" if I try "Standalone" it works or if I play as "Listen as Server"

#

any idea why is it happening?

#

look at the video, you'll see when I play as client, the print screen shows up inmediatly

sinful tree
mild lynx
sinful tree
# mild lynx Is there a different way to test adding a component using something that isn't a...

It's not specifically about the button press. You marked the component as replicated so that component should then exist on the client so you can try and reference it by doing something like "Get Component of Class". That being said, you also shouldn't need a client to tell the server to initialize it. The server should be able to do that itself without any input from the client.

mild lynx
#

It's a test for down the line adding a Component at Runtime that allows you to change into a diffent Actor. But not everyone gets the ability. I want all players to stay on the same base character BP, but add mechanics to a select few people.

sinful tree
mild lynx
#

If there is a more practical way of doing this, I'd love to research it, but from my understanding, components can add stuff like this.

sinful tree
#

This wouldn't happen on standalone or listenserver as the client is technically the server.

mild lynx
#

Then how would I do it? That's the part I'm caught up in.

#

I've done replicated a lot beforehand, but this is just a bit different to me.

amber fiber
#

@sinful tree if I move the projectile back it collides half the way from reaching the wall

sinful tree
# mild lynx Then how would I do it? That's the part I'm caught up in.

So again - you've already added the component to the actor, so it does exist. The problem you're having is that you're taking the return value of something done on the server and trying to use that return value on the client which won't work as that code never executed on the client. You can use Get Component of Class to find that reference, both on the client and on the server afterwards.

You shouldn't need to pass through a reference to the component from the client to the server as the server can get the component itself. At most, you'd want your client maybe doing an RPC to request the addition, but it shouldn't need to pass any of these values as the server already:

  1. Can find the appropriate component using "Get Component of Class"
  2. Can get the reference to the character in question as "Self" also exists on server.
  3. Can get the appropriate player controller from of the character by using "Get Controller" which can then be cast to player controller.
  4. Can get the reference to the camera boom as it also exists on the server.
sinful tree
mild lynx
grim rain
#

Hello, Iโ€™m trying to make a game similar to Mario / pummel party . I have a lobby set up to host a game and a few levels but how to introduce a point system that is consistent when they go into a level and come back to the lobby? I am thinking to use gameinstance but wondering if there is any other methods thatโ€™s better?

sinful tree
mild lynx
#

Actually, it looks like it's working. I added a call event to the end of Initialize for Transform, and it seemed to put it all together.

mild lynx
torpid roost
#

So, I've been spending some time simplifying my camera control and got to a point where I really like how everything works together. However I'm running into one small issue. The rotation of my character isn't being replicated to the other clients. If I hold middle mouse button I can rotate the camera without rotating the character, this is good and by design. However, when I hold right click I want it to rotate the character and the camera, this is also working, but the other clients do not see this rotation happen. Any ideas on how to fix this?

sinful tree
#

Target Rotation in the below example is set as a rep notify variable (not sure if that's the best way to do it, but it works!)

torpid roost
torpid roost
#

Oh figured it out ๐Ÿ™‚

low violet
#

Hello. I'm trying to figure out multiplayer so I can add it to my project, but my wall jumping code isn't working. It should lunch the character in the opposite direction of the wall, and while it does so for the server, the client gets rubberbanded back to the wall. I have disabled the lag in the .ini so that's not a factor at the moment (although I will need to account for it later) Does anyone know how to fix this?

#

(The first pic runs off event tick)

torpid roost
torpid roost
#

With the 1st On Rep Target Rotation screenshot, the character and camera rotates with both middle mouse button and right mouse button (which middle mouse button should not rotate the character at all), but also does not replicate to clients.
With the 2nd On Rep Target Rotation screenshot, it does the same as the first, but it is replicated.
Without the On Rep Target Rotation, it does the same as stated originally, middle mouse button rotates the camera (which is correct) and right mouse button rotates character and camera (which is correct) but doesn't replicate.

elder kindle
#

Does anyone know of an example in the source code that adds items to fast tarrays predictively? I see that client prediction is mentioned in some of the fast tarray code itself so I assume that there would be.

sinful tree
torpid roost
hallow sand
#

I'm using a RepNotify to change a skin to something random on spawn. It runs every time the actor respawns. Is this done poorly / could cause overload?

clever plinth
#

Is there a value somewhere that can be read to determine how many clients are expected in a PIE session? In other words, I would like to know the expected number of players prior to them connecting and being added to the PlayerArray.

hollow eagle
#

No. How would the server know how many people are going to connect until they connect?

#

If you're asking about a matchmaking service that spins up a server and sends a group of players to it, that's on you to build and not something unreal would provide.

#

There's an option for a maximum number of players (AGameSession::MaxPlayers) in case that's what you're asking about.

clever plinth
hollow eagle
#

Ah I missed the PIE part.

#

Do they not connect on the first tick?

#

If there isn't a simple number you can grab from somewhere, you can probably count the number of PIE world contexts.

int32 PIECount;
for (const FWorldContext& WorldCtx : GEngine->GetWorldContexts())
{
  if (WorldCtx.WorldType == EWorldType::PIE)
  {
    ++PIECount;
  }
}
clever plinth
hollow eagle
#

Note that what I posted would include a dedicated server PIE instance in the count if one is running. You can check WorldCtx.RunAsDedicated if you want to filter that out.

clever plinth
# hollow eagle Do they not connect on the first tick?

It would at least seem that by the time AGameModeBase::BeginPlay is called, they do not all have PlayerStates yet (although that might be different from actually being connected, I'm not sure about that distinction).

clever plinth
hollow eagle
#

Does checking the player list work on the next tick too? Probably easier to use that if it does.

clever plinth
hollow eagle
#

I guess PIE still does whatever network negotiation it does across a real network so it takes a few ticks.

clever plinth
#

Yea, the PIECount seems to hold up if I turn up the network emulation latency. Seems like a decent solution for this. Thanks

torpid roost
#

Wondering if I could get some help with this;
I'm trying to setup an interaction so that when the user is hovering over an interactable object, the player won't swing their weapon. As the interact button is left click as well as the swing weapon is bound to left click.
On the first screenshot, this is the event graph of my door, where I've set it up to open 120 degrees from 0. This works fine, however it only works for the single person. It doesn't show for any other, even if the server opens the door, the clients do not see it open.
On the second screenshot, I'm trying to set it so that on the branch, if "is interacting" is true, then it won't call the start attacking.
You'll see in the first screenshot I've set it so that if the user is hovering over the door, it should mark the player as "is interacting".

#

I've tested the on begin cursor over and end cursor over with a material swap, and it does indeed swap, but per client and server doesn't change it for client either. I'm guessing my is interacting variable isn't carrying over.

#

Okay, I fixed the attack issue, but still trying to figure out the replication. I just needed to cast to thirdpersoncharacter and grab the isinteracting variable from there.

#

Hopefully this is an effective way of doing it. lmao

#

Fixed server side replication, now if the server opens the door, it opens for clients, but still having issues with client side opening the door and replicating to other client.

onyx belfry
#

does anyone have a alternative to ?listen

#

im making a mod for a game that does not support ?listen and idk how to get around it

hollow eagle
#

If a game doesn't support listen servers it's likely because it was built in the client configuration. Running a server from that config is impossible.

rotund onyx
#

Does RepNotify call when a client initially joins a server and the variable is replicated to them?

marble gazelle
dark edge
#

Server opens door -> everyone sees door open

Client requests door open -> server opens door -> everyone sees door open

kindred widget
chrome bay
#

But only if the value is different from the current client value, if you want it to always be called whenever the var is received, you an add REPNOTIFY_Always to the property in C++

oak oracle
#

Hey guys , I got a little question , I am trying to understand a replication , and what i read on all the posts online , they say never trust the client, never make client to do something , do it on server and replicate , OKEY i got this , but then i opened tutorial on replication "Sprinting" and all of them doing this (Image).and as you can see before they change MaxWalkSpeed on server , they change MaxWalkSpeed on Client , and that value on client isnt comming from Server , isnt this Everyone saying "UNSAFE" way to do replication

oak oracle
winged badger
#

it doesn't start lagging it starts jittering

#

client movement is predicted, meaning client moves itself and RPCs movement to server

#

then just corrects when the server confirms this

#

if you were to set speed on server first, it would make the client move at lower speed then the server until its set client side too

#

and that causes corrections/jitter

twin juniper
#

Should I put multiplayer events (Run on Server/Multicast) for actions in my game in the player controller or the player state?

steep wolf
#

hey guys, how do I properly set up a UPROPERTY'd actor for replication? this actor represents the weapon of the character, and I wish to have it fire off a net multicast to trigger projectiles/melee swings etc, however, the multicast event is not being transmitted. here is the setup:

{
    const UWeaponDeveloperSettings* DevSettings = GetDefault<UWeaponDeveloperSettings>();

    bReplicates = true;
    SetCanBeDamaged(false);
    SetReplicateMovement(false);

    WeaponCharacteristics = DevSettings->DefaultWeaponCharacteristics;
    WeaponAlignment = FWeaponAlignment(DevSettings->DefaultWeaponHandling);
    return;
}``` ctor
#

i do not need to replicate everything on the actor, just the netmulticast stuff

twin juniper
#

For example I have houses in my game, each house has a player that owns it. Do I put "Claim House" in player controller or player state?

steep wolf
#
    virtual bool Server_SpawnProjectile_Validate(FVector2D Direction) override;
    virtual void Server_SpawnProjectile_Implementation(FVector2D Direction) override;
    virtual void NMC_SpawnProjectile_Implementation(FVector2D Direction) override;``` here is function declaration
```void AInfantryProjectileWeapon::PrimaryInteract()
{
    FVector Location(GetActorLocation() + GetActorQuat().RotateVector(WeaponCharacteristics.BarrelAxisOffset));
    FVector Direction((GetActorQuat() * FRotator(0.0f, 90.0f, 0.0f).Quaternion()).Vector());
    ProjectileSpawnerComponent->SpawnProjectile(Location, Direction);
    Super::Server_SpawnProjectile(Direction.UnitCartesianToSpherical());
    return;
}

bool AInfantryProjectileWeapon::Server_SpawnProjectile_Validate(FVector2D Direction)
{
    return true;
}

void AInfantryProjectileWeapon::Server_SpawnProjectile_Implementation(FVector2D Direction)
{
    NMC_SpawnProjectile(Direction);
    return;
}

void AInfantryProjectileWeapon::NMC_SpawnProjectile_Implementation(FVector2D Direction)
{
    FVector Location(GetActorLocation() + GetActorQuat().RotateVector(WeaponCharacteristics.BarrelAxisOffset));
    FVector CartesianDirection = Direction.SphericalToUnitCartesian();
    ProjectileSpawnerComponent->SpawnProjectile(Location, CartesianDirection);
    GEngine->AddOnScreenDebugMessage(0, 1.0f, FColor::Red, TEXT("NMC Test!"));
}```
marble gazelle
steep wolf
#

nevermind.. i figured out why. I called the Super implementation which was not configured correctly.

marble gazelle
#

hehe, goot catch then^^

steady musk
#

Hey guys. Is there anything like "IsListenServer"? Cause we have UKismetSystemLibrary::IsServer but I dont see anything about ListenServer

#

Nvm, I found an answer in this thread

peak sentinel
#

Is splitting weapon into UObject based states common as I think or is it a bad idea for multiplayer?

#

Our initial prototype with shooter game based weapons were nice but we implemented some other mechanics and code is pure sphagetti now

#

Like charged weapons, bolt cycle state etc

dark edge
#

Depends on if the player owns the house or the pawn does (maybe ai can own houses, etc?)

lyric mural
sinful tree
lyric mural
#

Omg i love you ty

#

I just realized i didnt have that on an event

#

Im having a weird issue though where the server player cannot move

sullen burrow
#

Oh god, I hate replicating... I am trying to replicate doors to other clients, but seems like the server doesn't really want to replicate it to others

lyric mural
lyric mural
sullen burrow
#

like, it stops here. It doesn't even print Test1

lyric mural
#

What event is calling open door

sullen burrow
#

oh wait

#

I think I know what's wrong

#

now I did it like this. Still doesn't work

sullen burrow
#

and the function is getting called from the player

lyric mural
#

You have multiple problems

#

That trace event is not replicated

#

And your open doors is executing a timeline on the server

#

The server needs to multicast an event thats running the code

sullen burrow
lyric mural
#

That timeline should probably be on the multicast event

sullen burrow
#

Ohhhhh

#

after I replicated the line trace to server, now it's working

#

thanks

karmic geode
#

Hello, i need some help if someone could help me i will be really greatfull !

It is possible to call a function from a Multicast (so, the Authority) but only on the target client ?

For example, when my IA attacks a local player, i call โ€œApply Damageโ€, and then, i use "Launch Character " on the damaged actor with โ€œOnTakeDamageโ€, and it works less and less as the ping goes up.

For example :

โ€ข Get damaged by an AI on Client with 0ms โ†’ Launched, smooth, perfect
โ€ข Get damaged by an AI on Client with 100ms โ†’ Got teleported in air, not smooth at all
โ€ข Get damaged by an AI on Client with 200-300 ms โ†’ Not moving at all

I know what is happening with 200-300ms, its because on the server, the client already jumped from the TakeDamage function and has already landed.

So, how can i do ? And it is only possible in the in-built prediction system ?

Thanks a lot !!

lyric mural
#

Does anyone know why this is always returning the server pawn?

peak sentinel
#

On dedicated I guess it will return clients

#

Use GetController instead

#

You need to cast to pawn from actor first

lyric mural
#

Thank you! I will try that

vivid prawn
#

how do you tell a dedicated server to create multiple sessions?

#

so what i normally do in case of hosting a level as a server

#

i create a session and then open the level with listen?

#

but in case of dedicated server, i believe i shouldn't open the level?

#

cause i could make 2 level and run at same time

#

and when i search for session i see the level created

#

though, what map is loaded!!?

#

cause i never passed any variable about the map when i was creating the session

#

do i still need to open level? but then when i do that how dedicated server knows for which session it should open the level?

#

though i just noticed when i try to make the second session, it fails

thorny fog
#

hello, can you please help me with that:
i have a function that leads to an event: (pic 1)
how should i replicate that event so both clients could see that animation? (pic 2)

thorny fog
#

one session with one level i mean

quasi tide
#

Client calls a Run on Server event. Server calls a Multicast event that plays the animation.

thorny fog
quasi tide
#

Your client must be the owner for the Run on Server event to work.

thorny fog
#

if i just multicast - client 1 sees that (if he's holding bow)
if i add server, noone sees

#

hmmm

vivid prawn
thorny fog
#

probably i should call that event from character then, not from bow bp?

thorny fog
#

or you can have some kind of connection handler so it will redirect your client to the dedicated server that is, for example, empty, i believe, but that is devops stuff, i'm not so good at it ๐Ÿ˜„

vivid prawn
#

oh, hmm... when i created a dedicated server i did register a port in my hub, does that means i need to make list of ports in my hub? and wouldn't ports clash?

#

so it was 7777

thorny fog
#

in the common way user can enter port after ip like - IP:PORT
but you need those to be opened and forwarded through NAT

vivid prawn
#

yeah, i do have that

#

i did register dns name as well to reduce the hardcoding ip address

thorny fog
#

i think you can assign session id to the port somehow and send user to that port from hub

vivid prawn
#

something like this

thorny fog
#

yeah and make the same to every port you use

#

or create batch file for that

#

but i dont recommend that basically. ๐Ÿ˜„
i've done so for my server and someone started ddos on that port after two weeks

#

if thats your home network and you have some kind of default routers

rocky night
#

Hi, may i askโ€ฆ ๐ŸŽˆ i need to set view target with blend in multiplayer. I try to get the controller but if itโ€™s triggered all player cameras get movedโ€ฆ its a simple Listen Server Session

thorny fog
#

at least don't keep that session listening all the time and for long periods so it wouldb't be noticeable in the network

vivid prawn
#

hmm.... but how can i manage them? this is very confusing

vivid prawn
marsh quest
#

hi, is it possible to add any protection against players using the command demospeed in an MP game? currently have that issue where players can bypass cooldowns by doing that

thorny fog
#

manage opened ports?
most of the routers have some kind if API

#

so probably you can call it from your session using custom fuction

vivid prawn
#

per port i mean

thorny fog
#

create list 'oppened ports" and add values ๐Ÿ˜„

#

and clear after session is over

vivid prawn
thorny fog
#

yeah, but you gonna need to run custom scripts if you are using blueprints

vivid prawn
#

haven't think of it that far ๐Ÿ˜„

bitter oriole
#

OR you can just go with nat punch / steam and ignore the 1990 port bullshit

vivid prawn
#

yeah, but need to see if my router has any API library can be access in UE

rocky night
#

Its meant to be for one player only

bitter oriole
rocky night
#

Its just a death screen camera

vivid prawn
thorny fog
vivid prawn
#

steamworks sdk right?

rocky night
bitter oriole
#

Ports are just not a thing people do

vivid prawn
#

okay, what is nat punch?

thorny fog
bitter oriole
#

Or just use Steam and it'll just work, but hey

rocky night
#

I give it a shot tomorrow, will let you know if it worked then. @thorny fog

vivid prawn
vivid prawn
#

@bitter oriole yeah that makes sense, though that means I need to have another server with another internet provider to be able to have a master server

sage isle
#

So I am trying to get into the server setup stuff for a multiplayer game and I am trying to get a handle on where to start, but for like a server browser, how does the game find all the available servers? As in if its trying to get the IPs and info for the servers that are running the game how does it actually get that information, is that where the subsystems come in?

twin juniper
#

If you decide to use a subsystem I believe it does STUN and routing for you. I remember using Steam's OSS a while back and pretty much you'd tell it if you want to host or join then it would handle NAT traversal for you and return a list of hosted listen servers that a player could connect to.

sage isle
#

Alright, cause I was trying to do some research but could not for the life of me figure out how the game is supposed to know all the ips and address's of the other instances of the game. So using steam it can do that searching for you.

twin juniper
#

yes

#

there are steam subsystem tutorials for listen servers

plush otter
#

is there a way to make RPC interface function call?

#

for example I want to call a run on server event on my controller from some locally spawned actor.

#

can I do that without casting

round latch
#

anyone seen Alen Loeb Multiplayer tutorial?

#

because I have a problem with it.

sinful tree
molten matrix
#

Is there a good way to spawn a particle system as a collision effect between two actors? I want to show some sparks when two items collide.

I've set up OnComponentHit for the actors and it triggers as expected. The problem is that OnComponentHit only seems to run on the server, so the effect does not show up on the clients.

I could do a multicast RPC from the server, but it seems wasteful in the case of a lot of collisions. This is not important information, it's just visual. The clients should be able to figure out that there's a collision on their own and spawn it locally.

torpid roost
#

Does anyone know of a solid way for me to implement the second screenshot into my first screenshot? Was testing out some multiplayer attack stuff and I really like how I have my blueprint running now. However the only thing I don't like is this sphereoverlapactors. It just places the sphere overtop of your actor and there isn't really a solid way to place that sphere in front of the player, at least from what I can see.

I'm trying to replace it with the multiSphereTraceByChannel, this lets me create a cylinder in front of my character and detect hits if it collides. Though it only gives me Out Hits, and I need this to be Out Actors.

Maybe I'm approaching this the wrong way, but I'm trying to get best of both worlds here.

Third screenshot is the entire blueprint for attack.

sinful tree
torpid roost
sinful tree
#

You can do it like this, or just use the current loop and use the actor reference from the hit result directly.

torpid roost
sinful tree
torpid roost
sinful tree
#

Create an array variable

#

What is happening is your trace is returning an array of hit results - hit results are a collection of data relating to the hit that was made with the trace you've done. When you "Break" the hit result, you're able to access the data that it has.
Since it's an array of hit results, you need to loop through the array to get the individual hit results so that you can get the hit actors from each hit result and add them to an array, or as I said, you could even use that first loop to just do what you want to do with the actors directly from the hit result rather than creating another array to store the actors in as then you'd have to loop through that array to do things with those actors.

#

Both of these essentially do the same thing. The first one saves looping through the array of actors (which could potentially be a bit of performance savings if there's enough actors in the array)

torpid roost
#

Can't seem to get it working, doesn't detect the hit of the actor at all.

sinful tree
#

Move the "Return Value" branch you have further head to before the first loop.
Also, your radius of your sphere trace is 0. It might be that it isn't hitting anything.

#

Check your collision settings too - it doesn't work quite as easily as you're looking for things that respond to the trace channel defined rather than just responding to specific object types.

torpid roost
#

Yeah, so it's colliding now, but not with the actors, so I will have to figure that out. I forget how to enable that, done it before though.

Additionally yeah, it would be better for it to respond to specific object types. Is there a more streamlined way of doing what I'm trying to achieve here?

oak oracle
#

hey ther can someone explain please what is UObject::GetLifetimeReplicatedProps() and why we need DROPLIFETIME()

rocky night
#

Hร„LP! I try to Blend the Camera to a closet for hiding. In Multiplayer it works on if the Host does it, but if the Client (Listen Server) enters the Closet all cameras from everybody go in the closet and are ejected for from there characters.

#

I tired to replicate the event with run on owning client.. but the client still creates all cameras of all players to do it

karmic geode
rocky night
#

yes its a lsitenserver match

#

dont know how to get just the player who is doing it

oak oracle
#

If you put actor on the map (Not spawn at run time) , and set it to replicate & AlwaysRelevant = true ,who will own this actor in this case ?

naive oar
#

Anything you place using the editor is owned by the server.

rocky night
#

mh i make a simple horror game where player just hide in closets... cant be so complicated

rocky night
karmic geode
#

maybe you can try to "A BP Player" -> "GetController" -> cast to "PlayerController" and then plug it

#

i saw a lot of people saying that "get player controller 0" is not recommended at all in multiplayer games, but maybe it is not the case here ๐Ÿ˜…

rocky night
#

ok let me try

#

@karmic geode mh the blend node only allow a player controlle rnode to plug in, get controller is not accepted

karmic geode
rocky night
#

this reversed it, so now the server changes the viewport of the client, but not the client from server @karmic geode

karmic geode
#

Are you calling a function from the server to multicast ? i dont understand quite what's the problem, the client dont see himself into the closet ? @rocky night

rocky night
#

Well its simple , player goes to bp closet, presses F and i set the body invisible and change the camera from the player with that node on the end.

#

the problem is, that the camera changes not just for the Player who is hiding

#

with this setting now, the client camera is not changing but from the server player it does

#

OH

karmic geode
rocky night
#

i call it now with a multicast

#

and now it seesm to work

karmic geode
#

oh nice ! ๐Ÿ˜„

rocky night
#

thanks man really appreciate it, will be happy to help back anytime

#

if i can

#

๐Ÿ™‚

karmic geode
#

you're welcome man, if i need help i will post here

#

have a good day !

twin juniper
#

I've got this that runs on Begin Player on my FirstPersonCharacter

#

I've got a replicated structure (playerinfo) which contains player name and profile picture (both gotten from steam and saved on startup)

#

I'm trying to make nametags work

#

PlayerInfo is set to RepNotify, which runs this function on Notify:

#

The Server can see nametags:

#

However all clients cannot:

#

I thought that if the variable is replicated it should be sent to clients? And therefore the OnRep function should run, updating their nametags

#

I think I cracked it

#

Not sure if there's a better way to do it, but it's working for me ๐Ÿ™‚

oak oracle
#

hey , can someone please say , why we need component replication on actors ? i got an actor where is just cube SM inside of it , i have changed its size , added impulse ,changed its color to some random value . and everything works just fine . my actor set to replicate but Static mesh component not , and its working absolutely fine . So i am wondering in which situations we need to replicate components ?

winged badger
#

when a component need to do basic position replication, has replicated variables or sends any RPCs that are not multicasts

#

also, if you want attachments to replicate

twin juniper
#

Is this the same as IsLocallyControlled?

bitter oriole
#

Nope

#

Probably works the same

twin juniper
#

IsLocallyControlled checks Remote Role, Net Mode and Local Role

winged badger
#

even in supposedly safe scenarios, indexes can still get shuffled around during seamless travel

#

resulting in 0 being a client controller on listen server, for example

#

not to mention a multitude of different misuses people do with it

#

if you have any c++ make a static function cpp UFUNCTION(BlueprintPure, Meta = (WorldContext = "WorldContextObject", CompactNodeTitle = "LocalPlayerController"), Category = "Local Player") static APlayerController* GetLocalPlayerController(const UObject* WorldContextObject) { UGameInstance* GI = UGameplayStatics::GetGameInstance(WorldContextObject); return GI ? GI->GetFirstLocalPlayerController() : nullptr; } @twin juniper

#

and use that, saves a lot of headache

solar stirrup
#

Hey! Is there a known issue with the online steam subsystem in 4.27? moved

#

oof didn't see it, thanks!

azure cape
#

hi, got a question
I wanna make a soulslike game and I wanna handle melee with two state machines in an animation blueprint, one that's always active that handles movement when not attacking, and another that gets switched depending on which weapon the player has equipped, done using animation blueprint linking
Would it be possible to sync the state of both of these state machines in multiplayer? if not, what other possible options are there to achieve the same result?

twin juniper
#

How would I go about using my own signaling server to broadcast listen server hosts

#

Would I just make a UDP request to the signaling server?

#

And there's also the issue of dealing with clients behind the same NAT

silent valley
#

This question gets asked a lot ๐Ÿ™‚
Two issues, the first is concept of 'master server' if you want to google it. Servers register their address with master server so other clients can find it. It can also provide the "introduction" of the client with the server to establish NAT connection.
As you seem to know robust NAT negotiation is quite a challenge and there's a couple of open source libraries out there you could try and use, or use a platform like Steam which handles the master server and NAT stuff for you.

twin juniper
#

Yah I wanted to avoid steam and try to use my own

#

The master server in this case is public and any client would be able to access it

silent valley
#

yes

twin juniper
#

But yah NAt negotiation is the problem especially when dealing with same NATS or ipv6 vs ipv4

#

Can you point me to some open source libraries?

silent valley
#

there's a bunch easily googleable, but I can't remember ever working on this stuff directly so I can't really recommend any

#

"nat c++ library" is a good start ๐Ÿ™‚

twin juniper
#

Cool so on my first question how does the server register their address with the master server? IS there a protocol to follow or could it just be a simple UDP request?

silent valley
#

yeah could be UDP, TCP, WebService, whatever

twin juniper
#

Correct,

#

I was thinking

#

If there was a propper way to do it

#

Or did it not matter

#

How I've done it previously is the client just sends a 1 byte udp packet to the server and the server then grabs the public IP And Port then sends it back to any other clients.

#

But this was outside of Unreal Engine

#

Ah okay

#

Is there a reason a RepNotify is only running on clients and not the server?

silent valley
#

Don't forget you want the servers to register, but also clients able to perform searches based on some criteria (num players, gamemode, ping, etc) so your master server needs to accept more complex messages. Might as well use the same kind of protocal for server and client registrations.

#

If it was me I'd probably do a webservice

twin juniper
#

Yah like a generic packet structure

silent valley
#

or JSON payload ๐Ÿ˜‰

twin juniper
#

Ooh okay,

#

I'll just look for some open source existing ones already

silent valley
#

Where's the fun in that?! ๐Ÿ˜ˆ

twin juniper
#

I guess it's just better to see how it's done properly.

#

Than constantly running into pitfalls

silent valley
#

Ship? What is.. 'ship' ?

bitter oriole
#

Release

twin juniper
#

Distribute

silent valley
#

sorry I was being disingenuous

#

it is of course entirely the right thing to do

#

unless your goal is to learn how to make a master server

twin juniper
#

A bit of both.

peak sentinel
#

Aren't impulses in CMC totally driven by server? I'm getting a stuttering on client when applied any impulse or force on server

#

It's a simulated proxy (AI character)

grizzled stirrup
#

Say you have a struct that also contains another struct that holds 6 int32s

#

If I was to set only one of those ints on the client and then send that struct to the server via an RPC, is the client paying the full bandwidth cost of all 6 ints?

#

Or will UE only send modified from default values, therefore only sending 4 bytes instead of 24 bytes?

azure cape
#

hey, I have a few functions on my player character that are defined in an interface
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Actors/ReplicatingFunctions/
this tutorial explains how to define whether a function should run on the server or on the owning client
however, when I click the functions on my player character, they have absolutely no settings in the details tab, and the required settings are missing when looking at the functions in the interface blueprint
how can I set these parameters?

Guide to Replicating Functions in multiplayer games with Blueprints.

#

right now they're running on the client, but if I use switch has authority to check whether or not I have authority, the answer is always no, resulting in no control over the character, and if I don't, I can move my character around but he keeps getting teleported back where he spawned

#

multiplayer works fine on a fresh 3rd person template project, the only difference with mine as far as I can tell is the fact that I control my player character blueprint through a player controller, using that interface

azure cape
#

cause that made more sense to me
also means I can have an AIController control the player blueprint instead

#

anyway, solved it using IsLocallyControlled instead of Has Autority

kindred widget
#

You don't need to control a pawn to EnableInput on it. You definitely don't need to use interface functions for control inputs. Just bind that actor's InputComponent to the local player controller's input stack.

#

Then you can just put normal input bindings in it or anything else you want to control and just enable input on it.

azure cape
#

the interface also allows me to do stuff like control any pawn that implements it, which would be useful to test like, enemies that don't have AI yet

kindred widget
#

You don't have to have a controller to accept input though. You can have fifty thousand actors enable their input components into the local controller and just not consume the input and one press of W, makes them all run that binding.

#

Sorry, I'm just super allergic to interfaces. ๐Ÿ˜„ I spend too much time in the Blueprint channel.

#

If it works, it works.

azure cape
#

yeah but if blueprints rely directly on inputactions then how could they be controlled by AI

#

also turns out I didn't solve my problem, IsLocallyControlled is true and yet when I move I still get teleported back

kindred widget
#

They're not mutually exclusive? It's no different than the interfaces. Input binding calls a local action on the AI, or player controller calls interface event on the AI. Same difference.

#

If it works, go for it. For me it just looks like double coding. You not only have to put the events in the AI, but then you also have to go back to the controller and route the controller's controls to send to the AI, where as binding the local controller's input stack is a one time call, and then you just put input actions directly in the class.

azure cape
#

I really don't get it
like, can the AI somehow directly triggers inputactions?

kindred widget
#

Wait, are you talking about AI controller calling interface calls on the AI?

#

I was under the impression from your last message above that you were sending interface calls from your player controller.

azure cape
#

the point of the interface is that any player or AI controller would be able to control any pawn that implements it, without extra code per pawn on the player/AI side

#

the controller, the interface, and the actual player pawn

kindred widget
#

AI input should come from a base class. AI controller or BTs can access pawn actions through that base class that it needs. PlayerController can just bind the InputComponent. Then there's no need for controls in the PlayerController. Also your AI controller and Player inputs will be fighting each other anyhow. Usually better just to trade possession and put the AI controller back when player leaves the pawn. Instant networking capability that way too.

azure cape
#

I don't want both player and AI to control the same pawn at the same time, the idea was just to not have to implement both player and AI control stuff directly in each pawn

kindred widget
#

Well, most of that can be handled by using a base class. Single place to put them all and then reuse.

azure cape
#

not sure what you mean by "bind the inputcomponent" too

kindred widget
#

Calling EnableInput on the pawn. Though if you're not going to let AI and Controller control at the same time, I'd strongly advise possession switch instead. As that will allow the player to own the pawn, and directly RPC controls through the CMC.

azure cape
#

okay

#

now the inputs are in the player character blueprint, still got that rollback issue tho
oddly enough, character rotation syncs just fine and doesn't get rolled back but movement does

dark edge
#

@azure cape you're talking about both the AIController and PlayerController talking to the pawn with the exact same events/interface, right?

azure cape
#

yeah

#

and I also still have that issue with movement not syncing from client to server