#multiplayer
1 messages ยท Page 97 of 1
and in the logs ```Script Stack (1 frames):
Pawn.OnRep_PlayerState
[2023.06.26-21.59.51:616][572]LogWindows: Windows GetLastError: The operation completed successfully. (0)
[2023.06.26-22.00.51:649][572]LogWindows: Error: === Critical error: ===
[2023.06.26-22.00.51:649][572]LogWindows: Error:
[2023.06.26-22.00.51:649][572]LogWindows: Error: Assertion failed: InOwnerActor [File:D:/UnrealEngine-4.26/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/GameplayAbilityTypes.cpp]
And whatever a dialogue is, is what you should be retrieving through the interface to send back to the client to execute.
If it is static data then you likely want to use references to that data rather than replicating a string.
why can I never find any results for the simplest things
You aren't looking in the right spot
or you're doing something new / unknown
often seems to be the case, but I just need to make a multiplayer event not affect the controlled player
literally just do it on the other players end but not your own game
can you ping the game mode with the controlled player you want to exclude from receiving the thing tell all the other players to do a thing
I even tried checking if locally controlled
then it just does nothing (as in doesnt change anything, event still happens to both)
Why cant you just use the built in character movement component?
mb, I misread
far too late for that now
I could list the problems with that for hours. well, maybe a few minutes
its nice to have a player controller that isnt constantly stuck to the floor
don't fight the engine
my player controller is infinitely better for the specific type of game Im making
I debated this for a long time, tried using default cmc for as long as I could but it just was not a fun game until I made my own
huh whats that I can push a physics object without launching the player into space? https://gyazo.com/d133d647f0f4ac78b1340ccf6409ded7
i c. I wish you luck, the CMC has circa 1000 lines of intricate code iirc
yeah thats the thing its built more for realistic games
or simple
idk what Im saying
but yeah mine works nice for this game, just makes multiplayer harder
not sure if anyone cares... but for the record getting rid of the spawners and just spawning one ai works so that's something.
see this works but decreasing this 0.2 delay any more affects the players movement on his end too (even though I literally tell it not to?) and no delay makes him locked in place https://gyazo.com/c304e42a2553cd56183cd307f6aeb002
even though Im sure I just did something that I already did earlier and it didnt work buuuut ok idk these things are very specific
Now introduce 133ms of lag and see what happens
yeah predicted movement and physics is a clusterfuck
it can work fine, until 2 clients disagree on what the box they are pushing is doing (since they are both in the future vs the other)
Non-predicted movement and multiplayer physics is just fine, everyone sees what the server sees
yeah, Im still doing this "ghost" approach kinda thing, the other player has no collision or even physics it literally just sends the location across
obviously I wanna avoid physics for multiplayer wherever possible
I was actually just about to see about testing that, Im wondering whatll happen
how do you simulate lag again?
play in editor settings
cant seem to find it
ah emulation nvm
YES THATS EXACTLY WHAT I HOPED FOR https://gyazo.com/000181f22cc06dd9c65b7260f06443c1
THATS WHY IM DOING THIS
So every widget should be in player character?
If you do it right, you only need one widget and feed it all the data you need.
Yeah but that one widget still need to be in the Player Character?
No it doesn't have to be. You can put it basically anywhere you want, but the RPC starting the interaction in the character and receiving the data in the character makes sense, you just route the received data where you need/want it.
If I wan to crouch
void OnRep_bCrouch()
{
StartCrouch();
}
void StartCrouch() //user input`C`
{
bCrouch = true;
}
I am doing it correctly?
Hi there, is there anyone that knows why the movement for the client is jittery? (Only when walking backwards & to the sides. Walking forward is perfectly fine), I've also replicated sprint which works perfectly forward, however, same jittery movement backwards etc.
Any ideas on this? I use Unreal Engine 5.0.3.
Does other clients know you're walking forwards or backwards?
I think you'd get what you describe if whichever client is getting the jitter was thinking that the moving client was always walking forwards.
Rather than other directions
I've added a flashlight so you can clearly see what's going on.
I've tried numerous stuff. Cannot seem to get it to work ๐
(Client is on the left)
its your locomotion blend space
The actual movement is fine
its your animation stuff
I disabled the animation, still got the issue.
No. bCrouch should be set on the server. The OnRep you would have it do whatever you need it to do if that boolean changes on clients.
Setting it on server will not set it on only server?
If it's a replicated variable (which it would be if you're doing an OnRep and if it has no fancy replication conditions) then setting it on the server will set it for all clients.
ah, I thought it don't need an RPC call because I am using CMC to set that variable
thank You for correcting me
Check #instructions for making a job posting.
does Unreal supports p2p ?
there was a discussion about that earlier actually lol
If you want to use replication and such, absolutely not.
You can add on your own network layer if you want to.
oh, all right, I will think about it )
But this would not be supported by anything in unreal, except for the fact you probably have some socket managing classes.
Thank You for quickly correcting me
I still donโt understand it ngl. sounds like what multiplayer does anyway. I guess listen server relies on the server itself than each otherโs machines?
Unreal.
so like rather than peer to peer, listen server would be like, peer to server to peer?
There are no "peers" in unreal. Everyone is either a server or a client.
I think the host is the client who host the game and has authority
oh so C is the host in this image
Correct.
That can be either a dedicated server (no player) or a listen server (has a player)
that makes sense then yeah
that reminds me that I always forget to playtest in other ways than just as client
this is the dedicated server?
Yes
I will definitely use it
also the project will open source, so people can correct my working dirty code
๐
Just to confuse things, you can get P2P networks where there is a single authority, but that's decided by the group and doesn't have to be respected. As everyone talks to everyone, you can say whatever you like "behind the back" of the "apparently" authority.
It's up to the machine you talk to to verify everything you say with the authority.
fine, I will not do P2P , Unreal has already a beautiful model I think
Unreal has the best model for gaming. By a long way.
But it's not the best for every type of game.
For instance, some games which use multiple servers and a lot of databases, might have a tiered authority system.
for the game like Arma it is best I think, I will not be using any sql db's, and already using 99% C++ for everything except bp animations and state machine and blendspaces
tried to do blendspaces with C++, but it needs to hard ref tons of animations, thats why choosed editor to do this job
@latent heart yo what should I use for dedicated servers? AWS and Azure seem to deny my debit card so I think I need a third party
Pretty much w/e you want
the vps I was using dropped the fact that they don't support game servers
so I can't use them
Yeah it was definetly the vps too
since the server worked fine on my pc\
I guess game servers are CPU intensive and it's an oversubscribed VPS provider that cut off people that use x% CPU for y amount of time
(though DO do that lol)
but with DO it's 100% CPU for a certain amount of time because they think you're mining
is there a delegate that fires when we leave the session on any reason(kicked, left, timed out etc)?
where is it?
not decided yet but I know about github or gitlab
will upload it there once completed
Aight, ping me then xD
Hi, I'm using the Advanced Input Actions on a Character Actor (Armour) that I want players to be able to possess. When it's the server the Armour can move fine but with the client it doesn't move.
Any ideas why?
p.s. When I use the previous InputAxis Turn & LookUp it works fine.
nvm I figured it out. For those that care, here's what I did.
I was using the Event Possessed to add Mapping Context but of course that's only run on the server. I added a custom event and use the overlapping instigator controller on the Enhanced Input Local Player Subsystem node. Seems to work now
I'm actually failing to see why the Enhanced Input mapping is better than doing it the old way
Seems fiddlier to set up
@stoic acorn You are aware that you are adding that on EVERYONE, cause you are using a Multicast?
Also there is OnControllerChangedEvent you can override that calls locally and on the Server
No need for an RPC
Hi guys I need help with a dialogue still
This blueprint is in my PlayerCharacter
This is in the NPC blueprint, why it doesn't call dialogue server?
Hi. Why the player state is not called inside game mode?
maybe the those player controller's player states are not BP_Master_PS
print the player state, what is it?
In widgets and other places, I can call it.
Another thing is to call c_call (client) in player controller -> s_call (server)-> get player state
Print the player state, what does it print?
When I saved to player state, I should have saved with the server? c_save -> s_save -> save to player state?
You should be able to get the playerstates just fine in the gamemode, however the gamemode only exists on server, so if you're trying to do anything in there as a client that might be your issue
otherwise there's a problem with your code
On EventOnLogout I'm tryint to cast to the player state, so I can get some info to destroy a gamelift session
If event on logout happens after the controller disconnects, it's possible that the reference to the playerstate is no longer valid. You should try to get the playerstate before logging out and see if that's the case
I've tried from player controller.
Tab -> server_call to game mode -> game mode cast to player controller -> get player state from player controller -> cast to player state -> get the info and it's not returning anything. But I suspect though, that I should have saved on the server at first the game state infos?
Wait you're casting the GameMode to a Controller? That ain't gonna work.
yeah I'm confused, screenshots would help
Also once the player has logged out, they are disconnected from the session - they can't make any Server calls.
The Server should be handling backend session management, clients should never deal with that
hey guys, im printing some values on "InitNewPlayer()" but the values are returning 0, even when playing as dedicated server
if (HasAuthority())
{
GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Green, FString::Printf(TEXT("GetNumPlayers(): %f"), GetNumPlayers()));
GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Green, FString::Printf(TEXT("playersPerMatch: %f"), playersPerMatch));
}
players per match is just a variable i set to 2 in the .h
am i missing something here?
Should work. The Gameplay Framework does all manner of stupid and unspeakable things when a player logs out to the Player States, but AFAIK that would work.
But since that info is not replicated and is server-only, it's probably better on the Player Controller anyway.
Player State is really more for sharing data with clients, and they are also swapped, duplicated, moved around a lot etc.
Here's a thing. I have 2 teams, TeamB players can possess and control a variety of 'Armour' items.
- When they possess an item I'm hiding their character mesh and disabling collision while they're 'out of body'.
- I'd like to be able to unpossess the Armour with a button press and have them re-possess their original character.
Question
What is the best way to retain a link between all Characters and the Armour they're possessing?
My guess would be to store a variable on the PlayerController in question as it's only the server and owning client that care about that connection, but I'm often VERY wrong ๐ฎ
Is there a proper way to handle collision prediction between two players when say they are heading at each other? Small differences in position may make one player swerve left on the server vs. right on the client and vice versa. At high latency, this will require a very jerky reset to the correct swerve direction before continuing prediction. Now imagine this with more than 2 players and it starts being very hard to control
are you using the character movement component?
the CMC should handle all that with smoothing and replication
afaik
I have my own custom CMC(since RTS for lots of units). I know it keeps a movement buffer and acks moves, but I haven't seen how it can get through this particular scenario without a big jerk
if u have ur own custom cmc then u probably know way more than me about this
Yeah you could store a reference to their original body in the player controller, that should be fine if no one else needs to know about it.
i think theres a variable that allows you to set how big the error is before u get rubber banded
have u tried messing with that?
probably not the best solution but could help a bit
theres also some variables that let u ignore corrections but im not sure those would help u
since its a rts maybe it could work
so the problem is kind of like going through an obstacle. In the prediction, we go left around the obstacle, on the server it goes right. With say 150ms delay and enough speed, the player may get halway through the obstacle on the left side, but then the server message comes back and says, no, you should be on the right side. So then you kind of are forced to not do smoothing and jerk it to the right.
because if you do smoothing, you'd smooth through the obstacle
so its a pathfinding issue
not really, since it involves player vs. player collisions, which pathfinding doesn't do
the other player is the obstacle
i would love to help but i dont have a solution for that, its a bit above my head
i feel like u probably need to do some sort of validation
to be fair 150 ms now a days is a bit of an extreme case
so if its working fine with say 99ms i wouldnt worry about it
im getting about 30 to 40 ms playing with people from india/america with a server hosted in europe
bro how
tbh i dont know, my server is quite simple tho
only 6 players tops with a few extra actors
i assume that helps
maybe less info going through the internet tubes
I don't know what I'm talking about... but what if you override the correction and prefer smooth movement over correct movement
But if you do smooth movement over correct movement wouldn't they drift even more out of sync because smooth movement takes longer?
yeahhh once I said that I started thinking of a bunch of scenarios where that would be problematic, like being on the other side of a wall
So it would be constantly having to do smooth corrections instead of just one quick snappy teleport to the right position.
oh I don't mean like smooth corrections, I mean have an acceptable radius of not correcting the position
That opens the door for desync though
Say you're making a racing game and there's a fork in the road and Player A is aligned to go left and Player B is aligned to go right but there's a lag spike just before Player A decides to change direction and follow Player B to the right instead of left. The server thinks Player A is still going left because it didn't receive the inputs to go right. So it would have to issue a correction which appears like a teleport for Player A from right side back to left.
I suppose that's why network programming is a specialization
and if it didn't issue a correction then Player A and Player B would see different things and the desync chaos takes over
can you smooth over the obstacle
(take the mountain pass)
and if you let clients have authority over their position then cheaters can just fly their cars and teleport to each checkpoint then the finish line like its no big deal
I have text on the front of each player's house, how can I show the name of the player who owns the house? I have a variable with the controller for the owning player inside the house bp
when I travel to a new server as a client,do my actors save their variables? or is the entire game loaded as new besides of the game instance?
don't use the controller, controllers only exist on the owning client and the server. Other players cannot access the controller.
Use the player state instead, which incidentally also includes the player's name.
Also, a player opens the game build, will they always be standalone if they are not connected to server? or can they be client?
hey is there a lobby leave function?
use playerstate
not controller
It is so wonderful
in single player with no network connection, netmode will be NM_Standalone
NM_ListenServer if hosting a game
yeah, even with limited client authority, you still have other clients that will need to snap back since they got the server's version first before correcting to the other client.
Thanks
For some reason when a client joins they are switched to a spectator momentarily after correctly spawning as a pawn. Does anyone know why?
Let me guess the player controller isnt replicated or something?
Am I getting the player's name from the playerstate?
Ah got it
So I can just change the variable to player state?
Everything will work?
Why is a wonderful day today
momentarily after spawning, they are being switched to a spectator. jk but more info is needed to help with that.
Can't pawns commjnicate with the GameMode through an interface?
If you're running on a client, clients do not have access to the game mode at all.
Probably not but you def don't want to try to ever care about a playercontroller that's not your own.
but can't the client ask the server to get info from the game mode... which is kind of like accessing it?
I'm trying to unpossess a character and repossess it's original body. Can't figure out where to put the code
At that point you're no longer running on the client. Client would need to RPC to server, server would be able to access game mode through interface so long as the game mode implements the interface or through casting and directly accessing the functions of the game mode.
something weird happens when you unpossess a character. I don't remember what though
Player controller would probably be the best place to handle it. Client sends RPC to server request, server validates that they can switch back to original body, server has controller possess original body.
What's weird is that I can possess a character with overlap that communicates to the game mode (which is handling the possessing code)... but I can't do the same with a keypress
Thats because overlap events occur on both the client and the server. Keypresses only occur on the client.
aha, that makes sense
Hm this doesnt seem to work
where are you setting player who owns house?
and why is it not replicated?
This is in this gamemode (below)
hey all, I'm using AInfo derived class to store player XP. I generate the AInfo object on the server and it has correct property values on the server. but once i try to either pass it to the client or try to read from the replicated variable on the client, i get an empty AInfo object (the properties are set to default instead of my values). the AInfo derived class replicates and is always relevant. the properties on it are not replicated (but i've tried replicating them too -- same result).
does anybody know why that would be?
this can just be an onrep
onrep playerwhoownshouse -> set text or whatever you update
you never set Player Who Owns House
also you have a bit of a data race / sync problem
the pawn has the house it owns
and the house has the playerstate who owns it
what if they disagree?
.
OK so when do you set PlayerWhoOwnsHouse?
is there a function or something to call that can force a variable to replicate? for example i have a replicated array that sometimes when modified will end up being the same, but it utilizes the OnRep to actually do something so i need it to actually replicate back down to the clients
do not
other option ive considered is a struct that contains said array with a replicated uint8 and just tick up that uint8 each time it changes
yes, but given that there are some cases where when the array gets changed, the end result remains the same (oldarray != newarray) it does not trigger replication of said array
yes sorry
basically refreshes a bunch of uobjects
going to try marking it dirty and setting the property to use the push based model and see if that does it
nope still treats it as normal even without being marked as dirty oddly enough
edit: nvm aparently that is a config setting (not sure if related to iris?)
alrighty set it up to work wish push model and all that worked fine and as intended (planned to do this anyways) but same result. not sure of a way to force it to replicate aside from something like the above incrementing a uint8 alongside it to trigger it
could. ill try to refactor it, theres another way it can be handled that might be better overall
Hello everyone! so I just packaged my game for the first time (I'm new to UE) and I have my main menu with a create session and a join session UI, but it doesnt seem to do anything, has anyone encountered this before?
It works fine in the editor, I dont know if im missing something
I don't know if this also happens to have an issue with loading a new map, do you have to select which maps to export when you package a game?
yes.
in my animation blueprint event graph im getting the camera pitch and storing it in a variable, but when i print the string playing as listen server, the value alternates between what the value should be and some fixed amount
it also seems its accessing none trying to read property camera when the event first runs despite checking if the character is valid at the start of event blueprint update animation
Show some code as to how you're reading the value in the anim BP.
literally just getting the camera component from a validated character and getting the yaw and setting a value
if i remove all the math and print like this
values are all over the place idk
do I need the playfab sdk to use playfab
This only happens on listen server? What happens if you try dedicated or standalone?
There's probably some plugin they have in order for it to be used with Unreal.
i switched to controller rotation and seems to be more reliable. not sure why it prints the actual value and the default value one after the other like that, but appears to be working 
i say it works... it works on the client now but does nothing on the server
be replication problem somewhere
i heard linux is the best os to host ur game server is that true?
I'm speaking more in terms of Linux based operating systems in general and not for game servers specifically, but most often Linux servers run cheaper as they don't incur additional licensing costs for hosting providers so you usually get some cost savings, and there is usually less impact on available resources (like CPU time and RAM) when running a Linux server vs. running a windows based server. I'd argue that it's probably more important to work with something you're familiar with as trying to use an OS you may have never touched and as advanced as Linux can present a very large learning curve.
yeah ill use windows since its what im comfortable and familiar with
ive heard u need to type lines of code just to change the background
Well that's not true nor relevant to a headless server
Linux really isn't that hard for the basics
You can compile the game server executable from Windows
what is right workflow to host dedicated server ?
Can we finish multiplayer whole game ue5.1 first
than build unreal from github source.
host gamelift ?
Can someone help me in this area ?
You could, but its not a good idea. Since you are likely going to run into endless bugs on the built dedicated server which wouldnt have shown up in Editor.
You could test your dedicated server locally though.
@fossil spoke
Ok,
I have start from source build Engine than start working on content & gameplay for multiplayer. Right
is it epic team workflow ?
The source build simply allows you to compile a dedicated server executable
You could start with the launcher build.
what is difference in Visual Studio option Server Build on BUild VS?
is it only for locally testing game ?
I'm more confuse Now ๐
What is best way to profile dedicated server? I have mmo style game and it works players can play on server etc.. but sometimes server crash and I have no idea why.
Okay I found network profiler!
Profiling will give you performance metrics but not crash dumps. You need to analyse the crashes to see why
Am I right in understanding that when a var that is repNotify is updated on the server, the rep notify event would call on all clients?
When clients receive it yes
They behave differently in BP vs C++ though. Such is the unfathomable genius.
Strange, I have a bool that's repnotify but when updated by the server, the repnotify event doesn't call on the client. o.O The rep event calls on the server though so im a little confused haha
Paste codes
Nm, forgot to tick 'replicates' in the main BP haha. ๐
in MOBA game, for minion(pawn) that out of sight, does the minion still get rendered ?
when I override it then what?
Why does this damage code work with the server shooting the client but not the client shooting the server?
For most of my code I need it to work for the clients because at the moment it's only working for the server
I'm just not 100% sure why the clients aren't recieving info
Presumably because the client is not the owner of the actor. Clients shouldn't be telling the server to damage things anyway
The setup is very odd anyway
A multicast to set a replicated var
Hi everyone, I'm trying to make a split screen multiplayer co-op game in UE 5.1, but each time I try to move the character with a game pad, it still moves the first player and won't move the second, even with "Skip assigning Gamepad to Player 1" ticked. I have got the spawning a second player down, I just can't seem to move it. Does anyone know any work arounds?
How should I be doing it?
why is my dedicated server closing, when accessing him from editor ?
with build client it's fine, but ... that's odd !
MissingLevelPackage it says
ok wtf. been dealing with all kinds of issues with listen server stuffs. reverted project to a state where the problems didn't exist... yesterday movement was working just fine. today I'm getting the old issue of jittery movement and host looks like they're falling on the client screen. literally wasn't doing this yesterday.
Server applies damage and changes the health value based on what happens on it's end. Clients receive the value and respond via the Rep Notify
Clients should never change replicated variables
How do I do it tho
Why does AGameModeBase::PreLogin() not have a reference to the type of person trying to login?
A listen server is treated the same as an external user? So for doing password check, version check etc, I have to pass all the details to myself? Is there a way to just skip this for the server?
could you use switch has authority and if it is Remote do the password check, if it's Authority do nothing, or skip to the next stage of your logic?
Chances are Address will be 127.0.0.1 or soem such
I'm a noob so take that with a pinch of salt
Check what it says when you (pre) log in?
You could also try checking the netmode. If it's ListenServer and there's no players connected (gamestate->playerarray) then it will be the host.
This might be what I need.
So if I want extra stuff to end up in ApproveLogin(), which only gets Options passed to it, I can have the client send the extra data via this? I'll give it a try
@chrome bay I'm not really sure how I should be formatting my code so that all clients know what is happening
the code is always running on the server, so the local is always authority
hmmm - yeah, this would work. If no one is there, this is the first user, let them in...
String stuff yeah
Also how long ago did I answer that
3 months, sorry, didnt mean to necro, I was searching
Ah no worries
Not necessariyl a good idea on a dedicated server.
There might be reasons you don't want a user or particular users to join.
yeah - I'll try Exi's way - I think that is what I want
Its really annoying that we ApproveLogin on the listen server for the host themselves. If you reject it for any reason, it is a hard crash - lol
Maybe read the compendium once more and/or look at existing code. There are some courses too. It might take a bit to get used to multiplayer but building your game on a broken base knowledge is a really bad idea
I haven't found how to do it properly anywhere
That can't be true cause the stuff James meant are basics
The replicated variable already takes care of replication for the health. The Multicast is redundant
But why is it not working for the clients
because none of this is actually real.
It's unreal.
have you tried looking at any example projects and reverse engineering how they do it?
I have but it can be overwhelming
understandable. you're trying to set up damage right now?
Yeah
That OnRep function is fired when the playerstate has been replicated and should then be valid. You can use that override to then trigger other functions or broadcast an event dispatcher.
instead of using that any damage event... can you create a bp actor for a projectile as an example. and when that projectile's collider overlaps, check all overlapped actors then cast them to your player character. have a server rep'd event called receive damage in that character which is called from the projectile's overlap. the server handles applying the damage to the characters.
I'm realizing that saying that out loud probably doesn't help and a tutorial would be better lol
AnyDamage is called by ApplyDamage. Apply Damage can only be executed when you're already running on the server. The trick here is, is that you don't want to necessarily have a client telling the server to apply the damage, as the server should already know if the damage should be applied or not - eg.You'd spawn a projectile on the server that has an overlap that triggers Apply Damage, then the server should already know when the projectile overlaps and then it will properly call Apply Damage.
Your Health variable should be set as an OnRep variable. This means when your AnyDamage event is properly triggered, you can set the health variable as you need and it should reduce the health of the particular character and replicate it to everyone. The OnRep function for the health can then trigger whenever the value is changed on the server for any other clients, and then the clients can do any additional things you need, like updating UI and the like.
Your best bet may be to place some print strings around so you can see the flow of things.
I forget how useful the OnRep variables/functions are
They are the usefullest!
This is like when you buy your first pc after using a console your whole life
also sidenote I think I found what was causing my weird issue... there is a spectator class that spawns in before the hero class. changing the spectator class' attributes to something other than the hero class' attributes (i.e. spectator attributes) messes things up. so for future reference, don't change the default attributes gameplay effect, modify them via separate gameplay effect modifiers instead.
So I shouldn't be using multicast for the stuff that I do with animations etc?
does event post login take place after the server travel?
You usually multicast for visual / audio things that don't matter to gameplay. If there are variables involved you want players to know about and when they change, you use replicated w/ OnRep.
Ok, I think I understand a bit more, i guess its strange to me that all variables changed on the server arent changed on the clients and you cant do it with multicast
You have to declare which variables are replicated - they don't replicate everything as not everything needs to be replicated. So if you mark a variable as replicated, it will make its way to the clients if it's on a replicated actor that exists on the clients (ie. Player Controller only exists on the server and the client who is that player controller, so it can't replicate to anyone else. GameMode only exists on the server so no variables on it can be replicated on clients as clients can't even reference it, PlayerStates are always relevant and replicate to all, so they will always be replicating their replicated variables to all clients). Using OnRep is still making a variable replicated, but it gives you a handy function that gets called when the client receives a change.
There are conditions you can put on replicated variables too that can alter the replication behavior, like skipping the owner, owner only, etc.
If you're using seamless travel, no. If you aren't using seamless travel, think the answer is yes. but you can test with prints. actually I'm not even sure of this, test it yourself lol
whats the best way to replicate individual animation montages? do I make an event for every time one is used, or is there some way to do it with one event or something?
Hey all. I have an issue where my overhead widget for actors is showing at 0,0 in client, but is properly overhead in standalone/listen. I didn't think a component had to be set to replicate for things that are created at construction. Am I incorrect? The widget itself reads replicated data on the actor component, so the widget itself has no reason to replicate.
//header
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
UWidgetComponent* OverheadWidget = nullptr;
//source
OverheadWidget = CreateDefaultSubobject<UWidgetComponent>("OverheadWidget");
OverheadWidget->SetupAttachment(GetRootComponent());
Static widget, with static transform relative to the root capsule. All it does is read on the tick for current hitpoints, and set the name/level at run time.
After running in standalone, it seems to be working fine now. ๐คทโโ๏ธ
good job lol
Still having problems lol. Nothing works, until I run it in standalone, then it's fine after that.
Current issue is in standalone, the widget wil lface the camera. In client, it faces actor forward
I did it thx
How can I redo this code to work properly with multiplayer?
2nd half
This is for a aiming system (in third person)
Trying to wrap my head around multiplayer widgets. I have an actor that calls an event on the player character to spawn the widget (1st image), and then on the player character side I have a multicast to create the widget, which is then called by the server. This works and the widget is added to all players screens it seems.
On the widget i have a "close button" that calls a multicast/server function on the player character to remove the widget(3rd image). and it works as long as I use the "server" character, but I get an "access none" when doing it with the client and I'm trying to wrap my head around why.
goal is to have the window close for all players not just the owning player
because a client can't call a multicast
delete every multicast from your project
that'll force you to do it the right way
then re-add them for the correct use cases (temporary things)
there's no such thing as a multiplayer widget
widgets don't network
Im aware, i was saying that in context to what im trying to get to work
if you want a button press on a widget to do something anywhere but on the client, you need to call THROUGH a thing that can netowrk
I believe that's what im doing by using the player character no? As the player character is replicated
any time you're doing get X 0 my alarm bells go off
that's a bad idea
get player 0, get pawn 0, get playerstate 0 all of that
that should be an onrep tho
OnRep bWindowShouldBeVisible
and it should live in the gamestate
or some other replicated actor that everyone has at all times
So multicast is only for sounds and animations? pretty much?
and I should repnotify anything I want the clients to know
You should repnotify anything that is state
if a door is open, the health of something, the currently held item,
only multicast things where it doesn't really matter if it happens or not
Ok
So i'm getting rid of the multicast for the aiming animations etc
I guess I could do a repnotify on aiming and play the animation montage there
There are use cases for RPCs for stuff, like CMC uses rpcs and not replicated variables, but that's fairly advanced and not something to worry about right now.
Im runing a script on the server when it starts to generate a variable, Im doing it in the game mode blueprint, I need clients to have access to the variable but they don't seem to be able to cast to the game mode BP, what is the best way to do it.
Like, I could just create an actor bp and drop it in the level, run the server script on that and replicate the variable which the clients could access, surely there must be a better way ?
Hello, a question, how can I "possess" (event on "possess") a character in a mmorpg project? I want to make a mount system but I don't know how I can possess the client character with a horse (the horse is the other character)
funnily enough I was asking about animations earlier
still pretty clueless on what to do other than manually creating an event for every montage
Game Mode is only available on the server. Game State may be the actor you want to use as there's only ever one in a level and it is replicated to clients.
The same way as in any other multiplayer project. You use a "Possess" node while your code is running on the server feeding in the appropriate player controller and new character you want to possess.
Hi I know this question might be more specific to the physics channel but since it is also Multiplayer and replication related I am also asking in this channel. I am working on an Multiplayer project based on the chaos Wheeled Vehicle system in 5.1 on the Server side and in single player everything works fine but on the client side the movement just is jittering and resetting the vehicle to an previews position. The documentation & Tutorials only seem to work in 4.27 but not in 5. Is there any way to fix this?
There's many ways to approach it. A very basic way would be to add an input on your event.
but this way is still just making an event on every place that plays a montage right?
ah yeah, I was wondering if it could be something like that
maybe thatd be fine then
I did try something like that before but I think I just went about it the wrong way
Thanks, ill look into the game state
...
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
UWidgetComponent* OverheadWidget = nullptr;
...
ANpcCharacterBase::ANpcCharacterBase()
{
PrimaryActorTick.bCanEverTick = true;
bReplicates = true;
OverheadWidget = CreateDefaultSubobject<UWidgetComponent>("OverheadWidget");
OverheadWidget->SetupAttachment(GetRootComponent());
}
void ANpcCharacterBase::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
const APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();
if (IsValid(PlayerController))
{
const APlayerCameraManager* CamManager = PlayerController->PlayerCameraManager;
if (IsValid(CamManager))
{
const FVector CamLocation = CamManager->GetCameraLocation();
const FVector fVector = GetActorLocation();
FVector NewRotation = (CamLocation - fVector);
OverheadWidget->SetWorldRotation(NewRotation.Rotation());
}
}
}
How do I get an overhead widget on an NPC to face the client's screen, specifically in C++?
Currently, if I play in standalone or Listen Server, it works perfectly. However, in Client mode, it just faces the forward vector of the actor and not the player's screen.
@drifting heath Not sure how you do it in c++ specifically, but I believe there is an option like render to screen not world or something
so I dont think you need to manually rotate it, you should just be able to toggle it to render to screen in c++ somehow
I'll try that. I figured using render to screen would make it look weird, versus like it was actually above the NPC's head, but I didn't try that yet. I'll see what happens
Yeah... I'm a derp. Nevermind. It looks perfectly fine using screen, and functions properly.
well it depends what you are going for, like screen may make it show infront of objects im not sure, that might not be what you want so...
Yeah it's showing through objects but that can be fixed.
Do I need to run spawn sound at location on multi cast and server or just server?
๐ ๐
๐ ๐
Depends if the server has speakers or not
still not sure what's up with the 2x2 emoji grid that you post with every message
a multicast call on the server runs on the server and all relevant clients
Guys, can someone help me with a bug that I have in a multiplayer game?
Is it happening to me that when I start a game I activate a cinematic where the players see it and when my game mode ends it takes care of owning the players but sometimes there are players who don't own them because it's due?
Anyone know why the ping is always 9999 using Steam Sessions? I didn't have this problem on another project I used Steam Sessions with.
If I call SpawnActor on the server and then immediately call a NetMultiCast, Reliable function on said spawned actor, the client never receives the event. I also tried calling my multicast event in BeginPlay if HasAuthority(), and still no. Do I have to put it in PostNetInit or what's the right play here?
Actually, I can do this with an OnRep so I'll try that ๐
hello multiplayer discord, it has been a few months, but I am back to working on this networked project. i can't wait to royally screw this project up as I have managed to forget everything I learned. gonna be so MUCH FUN ๐ซ
Same boat haha
Make sure you have source control
that is an exellent idea, why was this not in source control? my past self has been slacking
oh yeah, because it's kind of a pain to put all of these binaries into source control.. maybe i'll exclude them or learn git lfs or something
You can set up github sc easily
https://www.youtube.com/watch?v=Lg-UATetjbY&ab_channel=SkywolfGameStudios
Source Control can be a pain on systems like Perforce, Subversion but in today's video I'm showing you a very Quick & Simple effective way to do Source Control for Games & Projects using a Folder, Github, Github Desktop, and Unreal Engine 5! This works with older Unreal Versions and many other projects as well.
If you need to Add any Existing P...
Thanks, I didn't know github had a nice unrealengine .gitignore file, I'll be stealing that. I think I am going to use git lfs for the binary assets though, but I will be using bog standard git for everything else
Awesome, no prob ๐
woah github private repos are free now?
how do i make seperate inventories for separate players
I store the player inventory on the ACharacter class
Who knows why AI Move To not working in multiplayer..dedicated server
blueprintImplementableEvents from pawns spawned in the server will only run in the server?
nvm, their not running at all
Has anyone profiled spawning actors on the server?
What do you mean ๐
Iโm debating between making my respawn mechanic just a teleportation and reset vs destroying and spawning
If you're using a system like Battlefield, where you're using the same model, same settings, same everything, that would probably be better.
If you're using an RPG style system with randomized loot tables, percentages, etc.. I'd opt for destroy & respawn
If someone can please help me, I'm attempting to do 2 things, when I shoot from the hip it shoots at the center of the screen. Which works. But when I ADS I want to shoot from a socket I created called "frontSightPost". So its always center when you ADS. For some reason even after replicating, it is always at 0,0,0 or some random value. ADS is replicated, I've tried ChatGPT for 2 days, still not helping lol. I am at a loss. This is C++. ```void AFPSCharacter::StartFire(const FInputActionValue& Val)
{
if (CanFire()) {
if (CurrentWeapon) {
bCanFire = false; // Disallow firing
// Only set a timer for automatic weapons
if (CurrentWeapon->bIsAutomatic) {
GetWorld()->GetTimerManager().SetTimer(FireTimerHandle, this, &AFPSCharacter::ResetFire, CurrentWeapon->FireRate, false);
}
if (HasAuthority())
{
Fire();
}
else
{
ServerStartFire();
}
}
}
}
void AFPSCharacter::StopFire()
{
if (CurrentWeapon && CurrentWeapon->bIsAutomatic) {
// For automatic weapons, clear the fire timer when the button is released
GetWorld()->GetTimerManager().ClearTimer(FireTimerHandle);
// And immediately allow firing again
bCanFire = true;
}
else if (CurrentWeapon) {
// For non-automatic weapons, reset fire immediately when the button is released
ResetFire();
}
}
void AFPSCharacter::ResetFire()
{
// Allow firing again when the timer expires, regardless of whether the weapon is automatic or not
bCanFire = true;
}
void AFPSCharacter::Fire()
{
if (bIsADS && IsLocallyControlled())
{
ServerGetSocketTransform();
ApplyRecoil();
}
else
{
// If not aiming down sights, spawn the projectile immediately.
FTransform FiringPosition = GetFiringPosition();
SpawnProjectile(FiringPosition.GetLocation(), FiringPosition.GetRotation().Rotator());
ApplyRecoil();
}
}
void AFPSCharacter::ServerStartFire_Implementation()
{
Fire();
}
bool AFPSCharacter::ServerStartFire_Validate()
{
return true;
}void AFPSCharacter::ServerGetSocketTransform_Implementation()
{
// Fetch the Socket Transform from WeaponMesh and store it in a replicated variable
if (WeaponMesh != nullptr)
{
ReplicatedSocketTransform = WeaponMesh->GetSocketTransform("frontSightPost", RTS_Component);
FVector Location = ReplicatedSocketTransform.GetLocation();
UE_LOG(LogTemp, Warning, TEXT("Server Socket Location: %s"), *Location.ToString());
}
}void AFPSCharacter::SpawnProjectile_Implementation(FVector SpawnLocation, FRotator SpawnRotation)
{
FActorSpawnParameters spawnParameters;
spawnParameters.Instigator = GetInstigator();
spawnParameters.Owner = this;
if (AProjectile* bullet = GetWorld()->SpawnActor<AProjectile>(ProjectileClass, SpawnLocation, SpawnRotation, spawnParameters))
{
FVector LaunchDirection = SpawnRotation.Vector();
LaunchDirection *= CurrentWeapon->WeaponDistance;
bullet->FireInDirection(LaunchDirection);
}
CurrentWeapon->AmmoInClip = FMath::Clamp(CurrentWeapon->AmmoInClip - 1, 0, CurrentWeapon->MaxAmmoInClip);
}
your gamemode class derives from AGameMode, so BP_CGGGameState needs to derive from AGameState rather than AGameStateBase
Why would you request the ADS position from the server, that just seems awful instead of just getting it locally
And it'll make the weapons feel unresponsive in ADS
Hello I have a ui button that when clicked, the button will set visibility to hidden on other widget
this works on client, but doesnt work on host, the widget still visible on host, fyi I run the game on Listen Server mode
Is this bug on host mode ?
UMG is not going to behave differently on client vs. host, it'll be something else
are socket transforms on meshes in characters automatically replicated?
Given they are not changed runtime, you could say so. They aren't replicated but should be the same on everyone
At least the relative one
struggling to get this ADS to work in multiplayer...
Hello. I am a newbie and I'm having a bit of problem and if someone could even point me in the right direction, that would be greatly appreaciated.
So the issue I am having right now is that things are working fine while playing in Editor, using those NetMode and NumberOfPlayers settings, but the Build is causing more than a few issue.
An example in animations, I've replicated the variables that are used to check states of animations and as I said before everything is working nicely in Editor, but in Build the animations are not playing.
Someone please help me?
is it possible to get another dedicated server ping before connecting through BP?
How to fix this problem? For example if player opens door and then set door rotation Multicast. --> other player joins dedicated server --> doesn't see door opened but collision works still. Only visual.
Should I make timer for example check if door is open every 10s and if it's open then set rotation multicast?
I think this problem also comes if client2 is long distance and client1 opens door. Then client2 walks to that door.
Don't use multicast for state. Use a variable and an OnRep
Golden Rule of Replication
Does anyone know how to change values โโfrom my gameState to my gameMode playing in dedicated server mode?
that is to say all client
I am trying to do that when a cinematic of the level ends in the blueprint of the level, it calls my gameState with a runOnserver function so that my gameMode does the possessing of the players. This event is marked in Multicast so that it can be carried out to all users but only to me. perform this mechanic well by playing RunOnServer this because it is
Is it a bug that if ApproveLogin() in GameSession fails in 5.1/5.2 - it crashes the client? What is the point of doing checks there then?
Fatal error: [File:D:\EpicGames\UESource\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp] [Line: 14939] Couldn't spawn player: Password incorrect
I wanna ask that how do we add option or widget through which we can just add friends search for friends by username and chat through them via dm (if u have any vid or documentation lmk)
Thatโs what I thought, itโs only meant for the client but when I took position of the socket locally it was spawning in a weird angle but worked fine in standalone. Maybe it was a bug that happened after changing code around but I was thinking maybe it was a replication issue so then I switched to this. Iโll go back and swap
If you're executing your multicast in your game mode that's why it is not working. Game Mode only exists on the server so the multicast isn't sent to clients.
Thank you very much for answering me, what would be the appropriate player driver? because I use the "playerController" of the "thirdperson" but the system only works with client1. I don't know how to make the reference to the player of each client. If you want privately I'll send you a photo of a basic function I did
It depends on what you're using to trigger the possession.
For example, if you're triggering this from an input from the character, you can get the owner of the character which will be the player controller.
Can someone please help me again : When shooting on the client, the client's projectile seems to be on a positive linear slope when firing in ADS. I take the ADS socket from the client and on the server it works perfectly. But the client its just slightly off on the Z-axis depening on the distance shot. ```void AFPSCharacter::StartFire(const FInputActionValue& Val)
{
if (CanFire()) {
if (CurrentWeapon) {
bCanFire = false; // Disallow firing
// Only set a timer for automatic weapons
if (CurrentWeapon->bIsAutomatic) {
GetWorld()->GetTimerManager().SetTimer(FireTimerHandle, this, &AFPSCharacter::ResetFire, CurrentWeapon->FireRate, false);
}
if (HasAuthority())
{
Fire();
}
else
{
ServerStartFire();
}
}
}
}
void AFPSCharacter::StopFire()
{
if (CurrentWeapon && CurrentWeapon->bIsAutomatic) {
// For automatic weapons, clear the fire timer when the button is released
GetWorld()->GetTimerManager().ClearTimer(FireTimerHandle);
// And immediately allow firing again
bCanFire = true;
}
else if (CurrentWeapon) {
// For non-automatic weapons, reset fire immediately when the button is released
ResetFire();
}
}
void AFPSCharacter::ResetFire()
{
// Allow firing again when the timer expires, regardless of whether the weapon is automatic or not
bCanFire = true;
}
void AFPSCharacter::Fire()
{
if (bIsADS)
{
GetSocketTransform();
}
FTransform FiringPosition = GetFiringPosition();
// If not aiming down sights, spawn the projectile immediately.
SpawnProjectile(FiringPosition.GetLocation(), FiringPosition.GetRotation().Rotator());
}
void AFPSCharacter::ServerStartFire_Implementation()
{
Fire();
}
bool AFPSCharacter::ServerStartFire_Validate()
{
return true;
}
void AFPSCharacter::SpawnProjectile_Implementation(FVector SpawnLocation, FRotator SpawnRotation)
{
FActorSpawnParameters spawnParameters;
spawnParameters.Instigator = GetInstigator();
spawnParameters.Owner = this;
if (AProjectile* bullet = GetWorld()->SpawnActor<AProjectile>(ProjectileClass, SpawnLocation, SpawnRotation, spawnParameters))
{
FVector LaunchDirection = SpawnRotation.Vector();
LaunchDirection *= CurrentWeapon->WeaponDistance;
bullet->FireInDirection(LaunchDirection);
}
CurrentWeapon->AmmoInClip = FMath::Clamp(CurrentWeapon->AmmoInClip - 1, 0, CurrentWeapon->MaxAmmoInClip);
UE_LOG(LogTemp, Warning, TEXT("Location: X = %f, Y = %f, Z = %f"), SpawnLocation.X, SpawnLocation.Y, SpawnLocation.Z);
ApplyRecoil();
}
FTransform AFPSCharacter::GetFiringPosition()
{
if (bIsADS && IsLocallyControlled()) {
return BulletSocketTransform;
}
FVector SpawnLocation = GetActorLocation() + (GetControlRotation().Vector() * 100.0f) + (GetActorUpVector() * 50.0f);
FRotator SpawnRotation = GetControlRotation();
return FTransform(SpawnRotation, SpawnLocation);
}
void AFPSCharacter::GetSocketTransform()
{
if (this->WeaponMesh && IsLocallyControlled())
{
BulletSocketTransform = this->WeaponMesh->GetSocketTransform("frontSightPost", RTS_World);
}
}``` I used debug spheres and the socket/spawn location of the projectile is correct , i replicate ADS correctly, everything is working as intened except the path of the projectile which I dont understand. This is UE ver 5.2.1
hi guys, i'm once again trying to get client-predicted projectiles working. The current approach I'm taking is spawning a client projectile, then RPCing the server with the firing info. The server then spawns their projectile, and that projectile ticks twice as fast until it has "caught up" with the client (basically i only tick twice as fast until the amount of extra tick time equals the client's ping), then the server projectile replaces the client projectile. Before catching up, the server projectile is hidden on the client.
The issue i'm having now is how to handle predicted hits before the server's projectile catches up. For instance, if a client hits someone point-blank with a projectile, but the server (receiving the firing RPC later) won't hit the same thing as it has moved. Should I be doing server-side rewind for projectiles, or just ignoring client hits with the fake predicted projectile and only using the server projectile?
Hey, anyone knowing a quick and good way of creating servers for your game, that still do work and communicate with Steam?
The "quick" way is to just use Listen host and a marketplace plugin. Otherwise if you want to use dedicated servers it's a lot more complicated.
i'm no expert but i think at some point, the server will have to trust client view under certain parameters
if the projectile firing and collision is faster than the average round time trip of your rpc firing, then the client view will be more correct and server view will always be slightly wrong , especially if the target moves at last second
so i feel like in these specific instances, the server should go with the client view and not kick off correction logic
i could be totally wrong though
any recommandations for marketplace plugins?
hello guys was having a issue im trying to make replicable a mesh from a PAWN , but can make it happen was trying to make variable replicated and not work
how can i achieve it
you should not replicate the character mesh
instead the PAWN?
i am not sure what you are doing here
what you trying to do?
you seem to be doing everyone on the local client
you should tell the server
to do this stuff
so pressing E should tell server to possess the hoverboard
then you need to make sure all collisions are propogated properly
its not as simple as doing what you are doing
im trying with and RPC but server posses the hoverboard and dont need that
your using playercontroller 0
dont ever use that node
get the proper controller for the pawn
right click, get controller, cast player controller
these should not be used, unless you know what your doing
they are bad
Advanced Sessions + Advanced Steam Sessions was the plugin of choice but last I heard it wasn't working so well with UE5. So I dunno, I don't have any other recommendations.
right there?
no
you want the players controller
not the hoverboard..
just right click get controller
and dont pass in the hoverboard
this throw this error
do u have free time to try to help me to fix that?
is there a way to make players possess an actor in the map, instead of using a playerstart?
Remove the default pawn class in your world settings, place and select the pawn you want the player to possess and look for the Auto Possess Player setting and specify Player 0.
Was thinking multicast, allow to all clients watch when a player is on a skateboard, my game is a skateboard multiplayer
My approach is player action ->RPC server-> fire event in all clients using multicast
did that already, it just spawns default players still
or rather, doesnt spawn in anything if theres no default pawn class
I can do it with a possess node in the actor, with a signifant delay enough for the player to have joined, but theres no way thats gonna be reliable
yeah this is dumb
already searched all over for anything about this and couldnt find a thing
all I need is to be able to spawn players with some variables set specifically for different maps, but guess Ill have to rely on another actor for that
Auto possess option
It has to at least be a pawn
but I just
You don't possess actors
yeah its just my regular thirdpersoncharacter placed in the level
but autopossess does nothing
Ya just check auto possess player 0
and how would it work it out for multiple anyway
It would be ass for multiple
well then how are they all gonna possess the same one
Multiple players aren't supposed to possess the same pawn.
I am using this blueprint in PlayerCharacter to Save Character, but I would like to create a new blueprint for make FQuests and variables. Is it possible to do it?
If you want pre-placed actors in multiplayer for players to possess, then you'd likely need to somehow get an array of all the actors that players could potentially possess in your game mode. You'd need some way of sorting said array if so desired, and then as players join the game you could use OnPostLogin to retrieve the actor in the array at index 0 and possess it using the "New Player" pin from the OnPostLogin event. Once possessed, you remove index 0 from the array, eventually using up all the available actors.
doing something similar rn with actors that are basically like playerstarts, but have the variables the players need too. then it just sets them and teleports to one
doesnt seem like the most reliable solution though
but it does work
hey, can u give me a hand with an issue??
Hi all, I'm multicasting the broadcast of a delegate, but the client that is bound to it is not having their callback function called. Does anyone see what I am doing wrong?
APawn* ClientOwnedPawn;
AUnownedDoor* ServerOwnedDoor;
void APawn::OpenDoor(AUnownedDoor* Door /* Door is not owned by player */)
{
Door->DoorOpenDelegate.AddDynamic(this, &APawn::OnDoorOpen); // this does not fire on the client
Door->Server_Open();
}
void APawn::OnDoorOpen()
{
// This does not fire on the client
}
void APawn::Server_OpenDoor_Implementation(AUnownedDoor* Door)
{
Door->Open();
}
void AUnownedDoor::Open()
{
if (!IsServer())
{
Server_Open();
}
else
{
Multicast_Open();
}
}
// UFUNCTION(Server, Reliable)
void AUnownedDoor::Server_Open_Implementation()
{
Multicast_Open();
}
// UFUNCTION(NetMulticast, Reliable)
void AUnownedDoor::Multicast_Open_Implementation()
{
DoorOpenDelegate.Broadcast(); // The callback above (APawn::OnDoorOpen) does not get called on the client
}
Any chance you don't have the replicate bool checked?
it is checked :3
I think you need to also add the delegate to the event's list:
OnBuffCompleted.BindDynamic(this, &UBlahBuffableComponent::OnOwnedBuffCompleted);
NewBuff->ServerOnBuffCompleted.AddUnique(OnBuffCompleted);
Sorry, I'm having trouble understanding. Could you amend it to reflect the above example?
anyone ?
Yeah I usually do them like I posted above, so you'd (on your pawn) have a delegate, something like:
FOnDoorOpened::FDelegate OnDoorOpened;
Then you'd bind the function you want to that event so:
OnDoorOpened.BindDynamic(this, &APawn::OnDoorOpen);
Then you'd register that delegate with the dispatcher on the door:
Door->DoorOpenDelegate.AddUnique(OnDoorOpened);
worth also seeing if it's a problem of:
- Pawn event not hooked up to delegate correctly OR
- Multicast not reaching the client correctly
could be either
What would be a quick way for me to discern if it is #2 or not?
Like seeing up a UE_LOG in the multicast function to see if it reaches the client?
breakpoint or log or whatever yeah
if you only get one log per instance that's the server only
Will breakpoints work on the 2nd PIE session?
yep
It can sometimes be a bit annoying to find out if you're on client or server, but "RemoteRole" on actor is usually a decent way
Is there a way to easily tell if the breakpoint is referring to the first or second PIE session?
and in this case # of calls will inform
yeah breakpoint -> RemoteRole IMO is probably the easiest. Print string in BP is nice cause it dumps whether it's client or server ๐
Oh...one more complication...in the actual situation I am debugging, ADoor is actually UActorComponent
yeah shouldn't matter, EXCEPT that you'll have to also check the "component replicates" bool on that component
Although if it's an actorcomponent it shouldn't start with an A ๐ฎ
yep, my example didnt reflect real life
nice, it is checked
any idea if you can easily force a variable to replicate to clients even if it hasnt changed?
Okay, this more accurately represents the execution flow:
APawn::Interact(UButton* Button) // owned by client
{
if (!IsServer())
{
Server_Interact(Button);
}
Button->Activate();
}
APawn::Server_Interact_Implementation()
{
Interact(Button);
}
class UButton : public UActorComponent // owned by server
{
public:
FOnInteractDelegate OnActivate;
void Activate() { OnActivate.Broadcast(); }
}
class UTerminalState : public UActorComponent // owned by server
{
public:
FOnPowerSwitchDelegate OnPowerChanged;
void TogglePower()
{
IsServer ? Multicast_TogglePower() : Server_TogglePower();
}
UFUNCTION(Server, Reliable)
void Server_TogglePower();
void Server_TogglePower_Implementation() { Multicast_TogglePower(); };
UFUNCTION(NetMulticast, Reliable)
void Multicast_TogglePower();
void Multicast_TogglePower_Implementation();
{
bPower = !bPower;
OnPowerChanged.Broadcast(bPower);
}
private:
bool bPower = false;
}
class ATerminal : public AActor
{
public:
UButton* Button;
UTerminalState* Terminal;
virtual void BeginPlay()
{
Button.OnActivate.AddDynamic(this, &ATerminal::OnButtonActivated);
Terminal.OnPowerChanged.AddDynamic(this, &ATerminal::OnPowerChange);
}
void OnButtonActivated()
{
Terminal->TogglePower();
}
void OnPowerChanged(bool bPowered)
{
// this is not being called on client
}
}
multicast is a surefire way (won't hit onrep, but you can have onrep and the multicast call the same function)
trying to avoid reliable multicasts and its something that i need to be reliable. i would of assumed there would be a simple way but i have yet to find it lol
eh, unless you're sending a ton of data, reliable multicasts are fine. Tbh variable replication itself is pretty costly on the CPU
wait I have to make one more change to my example, I f'ed up
push model ftw hehe. just wish when i marked something as dirty it would replicate instead of checking to see if its changed first -_-
you might want to check if you have any errors in your logs, I think you might be hitting some nulls on trying to call a client->server function with an actor component as a reference
I
AFAIK normally you can't pass components across the network
like you might want to make an interface on your button actor or something, or have the interact go to server with the actor (and then on the server, get the component)
yeah if you're using Iris I have no idea lol
thank you!
just updated UTerminalState to accurately reflect the flow in my program
not yet. havent tinkered with iris yet, not 100% sure what all it entails lol
this is what presently happens
Right here though it seems like you're trying to send a UButton (which is a component) across the network in Server_Interact
APawn::Interact(UButton* Button) // owned by client
{
if (!IsServer())
{
Server_Interact(Button);
}
Button->Activate();
}
APawn::Server_Interact_Implementation()
{
Interact(Button);
}
Like I would do:
APawn::Interact(AActor* Interactable)
{
if (!IsServer())
{
Server_Interact(Interactable);
}
}
APawn::Server_Interact_Implementation(AActor* Interactable)
{
UButton* Button = Interactable ? Interactable->GetComponentByClass<UButton>();
if (!Button)
{
return;
}
Interact(Button);
}
Bonus points if you have an interface or something to allow interaction with different kinds of things instead of directly casting
yep, this is what I do
but yeah passing target across the network as "actor" is always safer
Server_Interact(Interactable) I might be misunderstanding, but isn't this sending an actor across the network? Does that work but sending a component doesnt?
This is the actual function being called from the APawn's component that deals with interaction:
void UVrCoreHandManager::HandlePrimaryButton(UGripMotionControllerComponent* MotionController, bool bPressed)
{
if (!IsServer())
{
Server_HandlePrimaryButton(MotionController, bPressed); // this just calls HandlePrimaryButton
}
// Handle Animation
// Send input to gripped objects
TArray<UObject*> GrippedObjects;
MotionController->GetGrippedObjects(GrippedObjects);
for (UObject* GrippedObject : GrippedObjects)
{
// Check if the gripped object implements IVrCoreInteractableInterface
IVrCoreInteractableInterface* InteractableInterface = Cast<IVrCoreInteractableInterface>(GrippedObject);
if (InteractableInterface)
{
InteractableInterface->Execute_SendPrimaryButton(GrippedObject, bPressed);
} else
{
// Check if the owning actor is implementing IVrCoreInteractableInterface
AActor* Actor = Cast<AActor>(GrippedObject);
if (!Actor)
{
if (const UActorComponent* Component = Cast<UActorComponent>(GrippedObject))
{
Actor = Component->GetOwner();
}
}
if (!Actor)
{
continue;
}
InteractableInterface = Cast<IVrCoreInteractableInterface>(Actor);
if (InteractableInterface)
{
InteractableInterface->Execute_SendPrimaryButton(Actor, bPressed);
}
}
}
}
inline bool IsServer() const
{
return GetOwner()->HasAuthority();
}
For an object to be able to be passed across the network as an RPC parameter, there are a number of things that need to be true for that not to be null
Replicated actors are always able to be passed, as are structs/basic types of course
but it gets hairy when you get to things that are just children of UObjects
but you don't have to take my word for it, you can see if the button is arriving safely on the other end of the server call or not
UGripMotionControllerComponent* MotionController has bComponentReplicates == true
like just check if Server_Interact_Implementation has a valid button when you go from client -> server
yeah but components replicate through their owner's actor channel, so it's a bit different
ie you can replicate vars and RPCs but the actual object isn't quite the same way
alright when the client hits the button it works for the listen server, but the client doesnt see it
if you happened to copy my code it doesn't have the Activate on APawn::Interact(AActor* Interactable) cause I was lazy
I very much appreciate your help @chrome onyx
haha yeah you got it, bud!
my guess currently is that the issue lay within UVrHandManager
because the buttons activate delegate isnt being fired on the client
although I'm a little puzzled, I would think that wouldnt even matter if what I'm really looking for is ATerminal::OnPowerChanged to be called, and the UTerminalState::OnPowerChanged delegate bering broadcasted from a mutlicast function on the server
seeing that when the client interacts with the button and the listenserver sees it...it is properly being sent to the server
but its just not making its way back to the client
yeah like it really depends how you're planning to get that stuff to the client again
Typically it's like:
Client (Request) -> Server (Do action) -> Multicast
OR
Client (Request, Do action Locally) -> Server (Do Action) -> Multicast (Skip requesting client)
First one's easier, second one is more responsive
Like normally for a door, I'd just do client hits button, sends request, server sets a replicated bool, with an onrep that causes it to open/close
wish I could use onrep more but I'm dealing with huge structs that contain tmaps
I have a centralized data store similar to redux
with lots of observers
yeah I usually just bite the bullet and use Tarray for anything that needs to rep
cause otherwise it becomes a nightmare
sometimes I'll recreate the map on onrep or whatever
but yeah ue doesn't want to replicate maps thats for sure
USTRUCT(BlueprintType)
struct ROYALDIVISION_API FBeagleState
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite)
FFeetState FeetState;
UPROPERTY(BlueprintReadWrite)
FEngineState EngineState;
UPROPERTY(BlueprintReadWrite)
FApuState ApuState;
UPROPERTY(BlueprintReadWrite)
FElectricalState ElectricalState;
UPROPERTY(BlueprintReadWrite)
FWeaponState WeaponState;
UPROPERTY(BlueprintReadWrite)
FTgpState TgpState;
UPROPERTY(BlueprintReadWrite)
FSensorState SensorState;
UPROPERTY(BlueprintReadOnly)
FActorState ActorState;
UPROPERTY(BlueprintReadOnly)
FMfdState MfdState;
UPROPERTY(BlueprintReadOnly)
FControlsState ControlsState;
UPROPERTY(BlueprintReadWrite)
FChairState ChairState;
};
with each of those state properties having many...many properties
yeah I mean I guess it depends how many of those have to be server auth/etc
for some reason the light replicates when the battery switch is flicked but the MFD panel doesnt show the right values ๐
but yeah if they could all change on server at runtime and have to be communicated that's trouble haha
Why it does show the widget, but it doesn't change the boolean variable to true?
GetPlayerController/GetPlayerCharacter/ Any of those "Gets" are usually not good to use in multiplayer. When executing in the character, try using Get Controller and casting that instead.
Otherwise, the boolean should be getting set within the playercontroller.
They really need to put s bit notice on these stupid functions
Big
People use then not knowing what they mean or the purpose of them
Just right click type get controller
why
nono
And delete that get player controller node
Ohhhhh, so thatโs how you get around the forced player index
Controller has a reference to its playerstate and its controlled pawn. Pawn has a reference to its playerstate and controller. Playerstate has a reference to its pawn (Pawn Private) and its owner is Controller.
Yeah, Iโd read that you need to get it from player state for multiplayer but I didnโt realize you just need get controller
I have never used those GetCrap nodes in any project
Right, I saw someone say itโs always index 0 unless itโs split screen, but I thought maybe that was wrong given that everyone said not to use get player controller in multiplayer
0 is first controller in list
I guess itโs just not doing the same thing the get controller is
FORCEINLINE AController* APawn::GetController() const
{
return Controller;
}
Index is the first controller in the list of conteollera
class APlayerController* UGameplayStatics::GetPlayerController(const UObject* WorldContextObject, int32 PlayerIndex)
{
UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
if (!World)
{
return nullptr;
}
// Don't use the game instance if the passed in world isn't the primary active world
UGameInstance* GameInstance = World->GetGameInstance();
const bool bUseGameInstance = GameInstance && GameInstance->GetWorld() == World;
int32 Index = 0;
if (bUseGameInstance)
{
const TArray<ULocalPlayer*>& LocalPlayers = GameInstance->GetLocalPlayers();
for (ULocalPlayer* LocalPlayer : LocalPlayers)
{
// Only count local players with an actual PC as part of the indexing
if (APlayerController* PC = LocalPlayer->PlayerController)
{
if (Index == PlayerIndex)
{
return PC;
}
Index++;
}
}
}
// Truncated....
Which I'd sat 0 fir clients but a server will have say 8 controllers
Oh ok so it would be different for the server, itโs always 0 for the client tho, right?
If you used controller 0 on server your always changing the first controller which might suck for players 2 to 8
I can see how those are vastly different ๐
Those nodes shod be used if you need to use then and understand them
I am using Get Controller, same issue. Widget show, but it doesn't change boolean
It's changing, I can guarantee it. There would be no reason why a boolean wouldn't be getting set. It's probably not being set where you particularly want it to or you're not reading it correctly.
Or its not replicated
Yeah, that seems to be the case with everything in the engine (need to know how it actually works), lots of things get misused because they appear to do be the right solution but arenโt necessarily it
Seeing as you were mentioning saves before, and you're working in multiplayer, it could be that you're setting the value on the client, but then trying to read the value on the server, in which case, you're changing the value on the client so that doesn't happen.
But again, it is getting set, it's more a matter of where are you reading it where it's not correct?
So if you donโt use any of these โgetsโ, what do you use then? ^^โฆ
I just told ya ๐
Controller has a reference to its playerstate and its controlled pawn. Pawn has a reference to its playerstate and controller. Playerstate has a reference to its pawn (Pawn Private) and its owner is Controller.
These classes are the primary ways in which a player would be interacting with the game, or in which anything would be referencing a specific player. From any of these, you can get any of the others as needed (with exception to controllers in online multiplayer of course)
Right, yeah, I was just confused by Kaosโ GetCrap nodes comment, I thought heโs talking about all nodes that start with get ๐
You will likely encounter further issues with that
So, I am making an endless runner game in integration with Playfab and Xsolla:
1.I am integrating playfab for Leaderboard and Authentication services.
2.I am also using Playfab Economy and created virtual currency on it.
3.I am using Xsolla store and payment gateway to purchase virtual items using real currency and virtual currency.
Issue:
1:While trying to import catalog of playfab in Xsolla, I am getting this error attached below. Any assistance would be helpful.
Did you try contacting them via the email in your screenshot?
i contacted Xsolla not playfab they are looking into it already
Where is the actual implementation of those events you are calling?
in blueprints
I was replying to someone else there
aah mb
๐ ๐
๐ ๐
If youโve contacted them, then thatโs your venue. It looks like an Xsolla issue so, no one here could prly help @random heath
Ok, so which part of the code are you trying to replicate? So far I just see calls to other events
Just wasent sure if the add movement input is replcated Because when I host my game in listen servers it really like weird its like gravity if fightning me or something
๐ ๐
๐ ๐
Don't make axis inputs RPC to the server reliable. You're asking for a bad time doing that. It doesn't need to be reliable as you're sending them every frame and you don't care if some frames are missed.
I think every custom event in my game is reliable lol
Witch ones should be?
๐ ๐
Only ones that must be executed for gameplay purposes and would otherwise "feel bad" if players didn't get responsiveness from. Inputs usually you want reliable, but not when you're sending the inputs every frame.
Multicasts if used correctly almost never need to be reliable - they are usually reserved for visual/audio effects.
Further more, if you're using "Add Movement Input" that's an indication you're using the character movement component and you shouldn't need to send the axis at all to the server, nor set the value on clients.
O Ok I see its just weird when I play my game it feels like gravity is fighting me?
That's likely something else. Make sure you plug in your axis value into the add movement input rather than setting the axis value and using that for your move forward.
Is there any good tutorials that shows you how to setup a basic multiplayer fps with dedicated servers?
Good? Probably not
If you're talking about just launching a server, that's trivial. Just launch it.
If you're talking about orchestrating a whole automatic-scaling backend, if you have to ask, don't do that. You'll just generate a $100,000 AWS bill.
So Garrysmod style servers, trivial.
Fortnite servers, hard.
wbt valorant servers? /csgo
Is it possible to establish client-listen server connection between 2 editors running the same project on 2 different PCs in the same local network? I've done it before with online subsystems and on packaged builds but now I need to do it on editor level so I'm wondering if that's even possible ๐ค
At editor time or play in editor?
play in editor
Sure just connect
hey i was trying to posses in multiplayer a Pawn(skateboard) but it seems that in client doesnt work
How to update that current players amount? I have dedicated server game.
Or is there other way to do it? Can't find anything on Google
I am having issues on my dedicated server , when my map restarts its over riding the code of where I want my pawns to spawn, instead spawning them in random player starts
anyone ever expirence this on map restarts?
Just update it.
Is ServerInfo a struct you added to something?
how do I even replicate something that isnt an actual player
like for example just a physics object, if I wanted that to use physics server side then dont use physics but just set its location on the clients
How would I go about getting where a player is looking from the server?
just wherever you set the rotation variable replicate only that
set his angle on client, then after that send it to the fake players
There's physics replication already
It runs physics everywhere but gently corrects it towards the server side version
4 and 5
what, all I hear is physics cant be truely done
Well you hear wrong
What can't really be done is predicted physics
If you're ok with ping lag between a clients inputs and the physics result then it works beautifully
how does this work then, because by default objects will just immediately desync because of simulating on each player
There's a replication handler which corrects them
how do you set this up though?
I just use the 'add controller pitch input' node so there isn't a variable I set. I've tried getting the control rotation from the player controller and setting it in a var that's replicated but it only seems to return 0,0,0
There's nothing to set up. Just make sure the actor replicates, replicates movement, and that should be enough. By default I think the replicate physics option is checked for the component that's simulating
oh you mean that, if I remember rightly control rotation is able to replicate automatically? so maybe its the way youre inputting it Im not sure
There's tuning settings in project settings
ah yeah, seems to be working, even if a little flashy looking, but if one player shoots one it only moves on his end. I havent replicated the shooting yet but shouldnt it still be doing something?
Yes the forces and impulses need to be serverside
I think i've got it, just need to get the instigator controller and cast to the player controller and get it that way.
ok nvm it immediately desynced in the next playtest
Make a target actor, give it a:
Begin play -> delay -> has authority -> random impulse
Tune your setup until server and client agree
Then start tuning it for smoothness. Stock settings are super strict
Ive been spawning it on a slope right now and letting it fall off
You should see corrections on client with the impulse, that's one way to test it.
but its not even falling the same way in the first place
jeez I just made a new actor thats just a cube for testing this and its even WORSE
on one client it just freaks out and disappears from the map immediately
what
first frame of the playtest on both players
can I not just fake it already

all I wanna do is just send across the location and rotation. I dont want to simulate physics for each player. Ive already done a similar thing in the player script but in this case I dont know where to get the location and rotation from in the first place. if it doesnt simulate on each player then where? where does it COME from
Unless the object it moving on the Server, it won't send an update to that client. A client can desync themselves permanently if they're moving the object locally and the server isn't sending movement updates to them.
exactly, so Im trying to run the physics on the server only
but now the multicast event wont do anything
even the damn print string isnt going through to the client
as if I suddenly cant do a basic event
Ah, multicast the apparent solution to everything
You don't neccesarily want to run physics server only, that'll just create input latency and give very jittery/snappy movement on clients. Clients should simulate so that updates between packets are smooth and objects are simulating properly.
Are clients controlling these physics objects? If so, make them pawns and possess them, uncheck "replicate physics to autonomous proxy" on the root component, then spam the server with an unreliable RPC about the current physics state of the object. That'll be basic client-auth physics.
theyre not being controlled, I set it up so that it only simulates physics on the server, that works, and then even the multicast after that returns the location in a print string but does nothing
It works in editor, but it won't work well in the "real" world
multiplayer do be like that
I know but in this case Im not actually doing a whole lot
literally just a regular server to multicast event
Is it alright to use something like playfab as a database but then use dedicated servers from another source? Does everyone else just make their own databases?
If clients aren't controlling the object, then litteraly all you need to do is check "replicate movement" on the actor. That's it
already did basically the same thing on the player except they use their own locations
no look I just did that
Clients WILL still simulate physics, whether it's simulating or not is determined BY movement replication.
theres no way Im trusting separate simulations
But they will diverge
The only answer then is don't use physics, use a deterministic sim
It doesn't matter what you're doing, even if it's just one object, in the real world it won't work
guys you are burying me it took me like 10 minutes to type that
You won't get a steady stream of transform updates at 60hz outside the editor/LAN
Physics networking is literally one of the hardest things to solve in MP btw, not to disuade you
it doesnt have to be perfect just not completely broken
yeah I know, which is why Im tring to AVOID simulating regularly on both
You can't without going into C++ anyway
Well, assuming you're using replicated movement
Which is the only sane way
I just want to fake the position
Well, I guess you can turn off replicated movement and spam the position with an unreliable net multicast every tick
Not gonna scale
But memes/it'll work
ofc none of the physics replication stuff mentioned earlier has any effect in that case
well this is pointless then
Ill have to make sure not to use any physics at all in any multiplayer maps
...in my physics based game
then don't mind me making my entrance once again: Is it alright to use something like playfab as a database but then use dedicated servers from another source? Does everyone else just make their own databases?
I mean pretty much ๐
I've done a lot of network physics stuff, the only sane way really is to simulate everywhere
yeah I mean as Ive said Ive always known to avoid physics in multiplayer but I dont see why it shouldnt at least do SOMETHING when I try to fake it
because its literally what I did on the player so that you can play without problems
at the very least Id be happy with individual non colliding objects
projectile movement is looking like the best chance
Well, projectile movement believe it or not also simulates independently on every connection.
And it really has the same deal in that if a client moves the projectile locally and the server isn't moving it, the client will desync permanently.
It's just more prominent with physics because things are much more likely to move "on their own"
what I thought projectile movement was fine for replicating
It is, but it's the same deal
well that goes for everything doesnt it? thats just regular desync that anything not replicated would do
Even characters can permanently desync, there's nothing preventing it from happening. If an object isn't moving server side, the server isn't going to send out updates for clients to apply.
But if replicated movement on two physics cubes isn't working, then something else is going wrong in your setup.
its literally just
I dont even know anymore
I thought the clients didn't control the cubes?
but I can see that I simulated it on just the server
I mean that setup is inherently broken. Whoever owns the cube is telling the server it's transform, server is then applying it, and telling all clients to do the same, so there's a loop there.
If no clients own the cubes, then that tick RPC is doing nothing
And all clients are trying to set the positions of all cubes, while also being told what the position is
yeah Ive been asking about this in the first place actually
So they will just get stuck
because I dont know how to just go from the server to the clients
no one owns this cube its just IN the map
Okay, in which case remove that tick function
Delete the mutlicast. And just check "replicate movement"
Fin.
oh my god
yeah thats what I did
ah yes, immediate desync
Also, some other sanity things to check:
- Cube must be the root component
- Cube must be replicated
<@&213101288538374145> despatch pls
still can be immediately desynced by just pushing it
You are using the default character implementation presumably?
no thats why I had to use the same location faking method on the players
Okay in which case I can't tell you why it won't work
Cus I have no idea if the character logic is sound either
most definitely not
but it does work if not influenced by anything else
no one mentioned root component before, I had a feeling about that but Ive never had to do that
and its not too convenient for some of my other things
the actors root component is it's transform, so it has to be the root object if you want replicated movement/physics
well thanks for the help, maybe I can do something with this. is there any way at all to correct desyncs though? or is it best to just try to avoid anything else influencing the movement
hey all, i'm trying to figure out why a scene component attached to a camera on my character has the wrong roll rotation. Before i've done anything to it, it seems that the world roll rotation is 90 degrees off for everyone except the owning client...
translation and other rotation values are correct, im struggling 
the translation is replicated if its in a character... i see the replication symbol when i drag out
Well, if the client moves an object and the server doesn't know - there's no really anything the Server can do. The alternative is sending movement transforms for every object all the time, but it's obviously very wasteful and doesn't scale well. Generally you just need to keep the overall game state in sync and things should be mostly smooth
oh interesting. if i subtract 90 degrees from the camera roll then it fixes it and the values line up
hacky solution because i need the rotation that was on the owning client for the rest of the logic
i guess just rotate the scene component lol.
Yo! I have a drag and drop inventory and i wanna replicate drop items
Because pickup items it's replicated
When you "drop" the item, you need to make an RPC to the server through a replicated and owned actor/component. So if you have an inventory component that your inventory is stored in, that may be the place where you want to put that RPC. So then in your OnDrop function in your widget, you can call that RPC in your inventory component and do what you want to do when an item is dropped.
What means rpc?
An overview of the essential concepts for writing multiplayer game code in Unreal, in under 25
minutes or your money back.
Sample project: https://github.com/awforsythe/Repsi/
Patreon: https://patreon.com/alexforsythe
Twitter: https://twitter.com/alexforsythe
00:00 - Introduction
01:24 - Net Mode
03:33 - Replication System Basics
05:13 - Acto...
is there anyway with replicating UObjects to have the UObject's properties utilize replication conditions such as COND_InitialOnly? or even push based. currently no replication condition makes any difference, even if the property is set to be pushed based it still checks and replicates all the time even when not marked dirty (only difference was the OnRep never fired oddly enough). same goes with all COND_InitialOnly properties
how do you make linetracing recognize you are clicking on a different client player
Islocallycontrolled node might do the trick
how do clients work? do they get a number or something?
im eventually trying to pull theplayfab name out of which client i click
Thatโs a loaded question
Prly by accessing the referenced pawnโs player state, but someone else here can prly give you the correct answer
can you explain to me what kind of stuff should be going into player state or no
is player state even relevant if im using playfba to handle player info
Idk anything about playfab. See Daturaโs msg here #multiplayer message
Thereโs also loads of resources pinned
Well I thought you said you want to check if the hit actor is a diff client
Youโre asking if the current actor is locally controlled, and then running it on the false, so thatโll prly never work
ya im just seeing if i can open my other player's inventory first
Drag off the out hit of the line trace, break hit result
Grab the out hit hit actor and run the check on that
what am i getting from hit actor? the capsule?
no get player pawn option
Getowner
When a server calls a UFUNCTION(Client, Reliable), does the server also run that function? 
Or should I be calling the _implementation myself?
Client means run on client no?
it does, but i thought the server also entered the scope for some reason? and i feel like i've gaslit myself now
so i got the correct widget to show up but if im just trying to click another client do i check if the pawn is locally controlled for the location inputs? cause its just opening the widget regardless of where i click on the screen
Show code
Ok alot of that seems wrong, idk why youโre getting owner and trying to run code when the value is nullptr. And you donโt have start and end vectors plugged into your line trace
im seeing if its clicking owner char or another char
idk what to even put for location tbh this is my first day line tracing lol
Thatโs not what isValid does
It checks if the incoming reference is a valid object or None (nullptr)
well i couldnt plugthe get owner into a branch
I told you to check if it is locally controlled
get owner doesnt go into locally controlled tho
Nvr said to get owner
?
Lol Iโm losing my mind sry too many chats
i cannot. so for location inputs though.... what even goes into that if im clicking another client
Hit Actor is an "Actor" reference, you need to cast it to "Pawn" to check if it is locally controlled.
In the below image, the Weapon_BP and Weapon_BP_3P are ChildActors that use a ParentSocket and ChildActorClass set to a Weapon blueprint of choice that has a first person field of view material (for ADS and object clipping) and ADS offset values. How can I hide Weapon_BP_3P from the first person camera/player and hide Weapon_BP from other players.
does this make sense to you, and what goes into the location inputs?
You're definining the locations of where in the world you want your trace to start and end.
its a topdown game tho, so i have no idea. do i use the camera actor or something
If you have no idea, how would anyone else?
Think carefully about what you're trying to accomplish with the line trace. What do you want to trace from and to?
my cursor to a character
You can use the show trace options to actually see what youโre tracing at btw
tru
You may not even require a trace for that. There's usually an "ActorOnClicked" event you could potentially utilize. Only trouble is, is that you've got to implement this on any actors you want to click.
Technically speaking, your mouse doesn't really exist in the game world unless you've made some fancy 3D mouse that does. But you can do traces from the mouse using this node.
actor on clicked didnt work
just opens the owning player's inventory widget instead of the otherplayers inventory widget
That's because you're getting the local player.
ya but its comin off the false exec
No i mean, you're using "Get Player Pawn 0" which almost always returns the local player's pawn. So of course it is going to be locally controlled.
i see
"On Actor Clicked" is something you implement in actors you want to be clicked on.
so i should stickto the line tracing?
Well, you could just try removing the cast, checking if self is locally controlled.
ah ok
worked but its opening the owning widget as well as the other widget now
im tryin to think of how i could prevent the owning player inventory from opening if i click the other player
i guess just set a is locally controlled where i open the owning player inventory lol
thanks for the help
Guys
Is there a download for the UE 5.2 AdvancedSessionsPlugin/AdvancedSteamSessionsPlugin?
Hey there, hope everyone is having a not-too-shitty Friday ๐ I have an NPC trying to invoke its own Server_ RPC, however I am getting this error:
No owning connection for actor BP_MyCoolNPC_C_0. Function Server_SetMfdPage will not be processed.
What is going on here?
I installed it today and it works. It's on GitHub here --> https://github.com/mordentral/AdvancedSessionsPlugin
It works on 5.2?
Yes
I'm using 5.2.0 yes, have not tested it on the latest release 5.2.1 though.
You can only send RPCs to the server through client owned actors, like Player Controller, their controlled character, or their playerstate.
It was recently updated I remember it wasn't working on 5.2 just a few weeks ago.
Nice, so I don't have to update anything
It does say to rebuild/compile everytime I launch ue5.2 tho
There's usually flags for Owner No See and Only Owner See.
can someone explain the difference here for BP_Chest's Count and the total amount of replicated properties count? i would of assume that the property count and count of BP_Chest should be pretty much the same no?
ChildActore doesnt have any "see" parameters.
You'd have to do so in the child actor blueprint for any meshes in it. Also not sure if using a child actor automatically assigns ownership to the parent, but you'd need to make sure it does if it still isn't working.
recompile
in your IDE
Whats this?
this is why i hate it when people strictly use blueprint
https://www.youtube.com/watch?v=AWVJcKk2r5s&ab_channel=SneakyKittyGameDev
Ultimate FPS Framework Plugin: https://www.unrealengine.com/marketplace/en-US/product/ultimate-multiplayer-first-person-shooter-template
Patreon: https://www.patreon.com/SneakyKittyGaming
Discord: https://discord.gg/W5g6pZXfjh
My understanding is that Count is the number of times that BP was trying to replicate (netupdate frequency) but the count of properties is the number of times things actually were replicated, but I may be wrong on that. What I do know is that 99.60 waste is high which means you can probably reduce the update rate for that BP. However the more time between net update frequency the less responsive it will be for when you need it to replicate. But since the net update frequency can be adjusted at runtime you're free to apply whatever conditions you want to increase or reduce it. Maybe based on proximity to characters or something. There's also ForceNetUpdate which can be manually called at the end of an event so that it will replicate even if the net update frequency is waiting between updates.
yep i actually just tested that and that seems to be correct. yea ik lol. right now im testing full blast because i was trying to figure out what the heck was going on since in my uobjects that use the actor for the outer i set them up to be push based and got very confused as to why it seemed it was not working as intended. i do have another question if you know. for example in my uobject i setup all the replicated properties to be pushed based and what i noticed was if i didnt mark the properties as dirty it would still replicate them but the OnReps would fire. i would of assumed if they were not marked as dirty then they would not even be checked or sent for replication but for some reason they are (push model is enabled in project)
I'm not too familiar with push model. I just RepNotify all the things. lol
same, at this rate ill stick with it so maybe iris will have some clearer info lol, in the mean time dormancy will be the top dog for this lol. thank you
actually guess i can test that inside of an actual compoennt and see if its just a issue in the uobjects

