#multiplayer
1 messages Β· Page 149 of 1
i have no idea then :/
@vagrant grail Have not messed with it myself to check, but could it be in the widget scale settings?
When I4m really close, the UI is so small, and when I'm far it's scaling up
it's more that it's keeping the same size
so it looks bigger when they're far away but it isn't
try #graphics they might now more
We kinda did something similar when a client could reorder things in a table of characters/units but since its game critical information for some game state related changes, we'd only allowed those changes to be made on the UI only (so the client mostly saw those as cosmetic/visual changes only) and not on the backing data storage. Meanwhile, the same client also dispatched an RPC to the server requesting it to change the order of the items but instead of doing it on the UI, it'd do so on the backing data.
When the server got the RPC, it either performed the change or not (depending on whether it was possible from his point of view). In case it was rejected, it basically just ignored the client request. For our use case, we didn't need any acknowledgement to be sent back to the client that, alright, you were right, or you were wrong. If the client mis-predicted, then the next time he'd open the same UI table, it'd see a different order (what the server deemed was right).
But obviously, this could go wrong should the client chain more actions together and start reordering players on the table while there was already a mispredicted one but we kinda ignored it because it's doing some ID checks in the background for ordering and the server will still be able to come up with the correct order of characters/units on his local side. It's mainly just a minor inconvenience for the client that it'll look as if he changed the order in a certain way, only to see a bit different one next time he opens the table. But also, mispredictions are almost non-existent in our context, so we didnt bother to go any further than this.
I am looking for any advice on how i can overcome this issue i have setup a multiplayer character selection menu with a weapon select. upon selecting the weapon it changes within the main menu but when I spawn into the multiplayer map only the server changes but not any of the clients please look over the screenshots and assist on where I've gone wrong, I know I'm close just missing something.
Hello,
Inside an actor how do I know if it is spawned by client or server? using Local/Remote roles?
with a HasAuthority check, true means server spawned.
I think
i mean, i know thats what it means, i think thats your answer
authority should mean you are on the server version
yes
what I need to know is if the actor is a proxy of the server spawned or client spawned
Im not certain why that wouldn't tell you?
has authority should also be able to give you results
dependent on your use case
you could also use a role check
which would return authority or proxy
I'll test the values and see π
Authority should only return if it's the server or remote (proxy), but if it's client spawned, I actually don't know what it'll return lol I'll check the roles those should be more specific
roles should return auth or autonomous proxy or simulated proxy i think
Yes, I should be able to get the info I need from that
thank you for the quick response i didnt expect it so fast
im fairly noobish so i someone can walk me through to work if its client or proxy spawn that would be a big help
okay i tried putting a authority switch in the actor with no luck would it be better to load it from the gamemode instead?
@latent pelican i think you are getting the two conversations confused... Shinzo was asking about authority. For you, I would first make sure my multicast event was firing.
ah okay thank you @rich crag
I actually have to check authority + netmode (It isn't server)
to check that it's a client instance
interesting...
authority would be true both on the server instance and the client spawned
and checking simulated just means it's a proxy
so it has to be authority + not server
so the role check didnt return what was expected either?
yes because the role would be authrority for both the server instance and the client spawned
as they both spawned it
that doesnt make sense for the role check
if the client spawns it it would only return one of the client proxies
the client should be unable to return authority, as server is the only authority
if the client spawned it, he would be the authority
not in role
that's what I was debugging
role is literall whether it is server or client
Local role is authority when it's client spawned
I'll remove replication and make sure 100% 1s
What do you mean?
it depends who spawned the actor
lemme make sure im clear on what im saying
an athority check should depend on who spawned the actor
yes which means both actors spawned by server and client will have authority over it
but the replicated proxy by the server spawned won't have authority
yes
which means for me to check that an instance is client spawned
it needs to be authority + the world it is part of is Client not host
which in BP is checked with IsServer and in c++ under the hood it's getting the netmode from the net drive and a few checks
OOOH i know why youre getting both from server and client
because youre running the role check on both
how would I know it's local
x)
usually that's the job of the role no? but since it's client spawned defeats the purpose
hmmm because using has authority switch might just be client authority
I feel like this should be much simpler
yes so the solution is, if you have authority and you're not hosting, you're by elimination the client
MP leaves simplicity at the door π΅βπ«
haha
This basically means it's client spawned
it's the same for server instance and client spawned
so I can't differentiate with that only
OOOOHHH it just clicked what im not catching
both are Local: Authority Remote: Simulated proxy
yep x)
slow today
could you handle it earlier, and just flag the client spawned as such on spawn, then check that flag?
I mean I could, just that there's a few spots this would be called and I thought it's safer to do it inside the actor
right on
ty for the help
that you for looking into it @gusty slate and @rich crag but how would i go about fixing it so it works as intended again I am a noob when it comes to MP blueprints
@latent pelican first put a print string on your multicast event and make sure the event fires. The multicast is what is responsible for all the clients getting the same information, so if it is not firing we need to move to earlier in the chain.
I haven't look exactly at all screenshots but with things like that you should probably use RepNotify not a multicast
and process the state on the RepNotify function
mmm yeah repnotify is good for that
the weapon type variable would be RepNotify which means each client will trigger a function when it's replicated to it
because imagine a new player joins, your pawn will be created for them, they weren't there when the multicast was called
but if you use RepNotify, it'll replicate that value and then trigger the function
where you should update the proper meshes/etc
because the repnotify just replicates a variable that is consistent and each client deals with that variable individually
Im pulling my hair out on my own issue
The server stops registering a constant collision once the actors are moving at too fast a speed
(copying from #cpp)
Good day all. Suppose I have two local players where A is signed into an OSS and B is a guest player. I then have player C, hosting a game, which A and B then connect to. Is there any way that player C can deduce that A and B are connecting from the same device (Say, getting the FUniqueNetId of player A only given player B's APlayerController)? (For context: Need to figure out a good way to get a nickname for a guest player - so I figure that using the nickname of the primary player on their device prefixed by a number is the way to go. The problem is getting that nickname given the player controller of the guest, over a remote connection)
It seems that getting the UChildConnection and tying it back to its parent would be the way, but if anyone knows an easier method it'd be appreciated
Seems that UChildConnection was the way. Next challenge in this scenario is going to be getting the local controller ID of the guest (B) from the host (C)- trying to do this without having to resort to RPC's, but it might just be the only actual way
https://youtu.be/YlrUa9rjaAA
An illustration of my issue, the blue is where the server says the helm collision is, the red is where the client says the collision is, I need to be able to maintain regular overlap for authority checks. Any clue how to mitigate this?
What could cause a client owned actor to not run a server rpc? I have replicates ticked.
Despite it actually not being Client owned, not much
I did get owner and printed it and it looked to be the right character.
Should I try to get controller id or sumthn?
Is there a way to make Foliage Instanced Static Mesh Component Replicate?
Adding / Removing Instances in the Component doesn't replicate at all. You'd have to do everything outside of the component which will get messy IMO.
Trying to do Interactable Foliage. It works on singleplayer of course. But yeah..
I've seen some games continue to use Foliage Instanced Static Mesh Component for their trees and add / remove instances, so I know they have a way to do it, but would it mean going into the C++ side of things to somehow make that component replicate for Blueprint use?
Why doesn't this update my health value on top of my head (health plate) for other players, but locally it updates that value for my healthplate but applies the same value to the other player too from the local camera. Let me explain :
- From Player 1 POV, I go through a Collision box that reduces my HP by 1 every second. From Player 1 POV, it decreases his HP above his head, but it also decreases Player 2 health above his head (to be the same value as Player 1).
- From Player 2 POV, he's just standing and watching Player 1 going through the damage zone but Player 1 HPs don't decrease above his head, and he doesn't see his own HPs above his head decreasing (so that's good).
The Widget Component is set to replicate, the health value to RepNotify.
What am I missing please ?
You must be displaying the local player's health for all players. Not sure why exactly. I think get player character at index 0 is always the local player but I could be wrong.
not that it's the issue but widget don't replicate
?
You should just assign the owner to the Widget. The owner being the character that owns the widget
how to do that please ?
Also are you changing health only on the client? If so, you should have any changes be made on the server and multicast the value
RepNotify is correct when changing health. It is a stateful change
Make an actor variable , call it Owner in your Widget.
Set it to instance editable and expose on spawn
When you create the widget, set the owner to the character
It is also beneficial in order to run stuff when the health does change
I don't multicast because of the explaination of Duroxxigar
Yeah I was wrong about the multicast but he still needs to make the changes on the server or it won't be replicated, right?
Yes
That's already the case
U run server RPC if u are the client
or simply set the health if you are the server
Clients will eventually get the server's health value
Don't use the Get Player Character {0} node either. Widgets have a way to get the correct controller/pawn. It's like, "Get Owning Player" and "Get Owning Player Character" or something like that
It is decreasing player 2's because you are getting the same character that you are getting for player 1
Specifically because Get Player Character 0
I have "Get Owning Player" or "Get Owning Local Player", but it returns a PlayerController while in my case the "health" variable is in my BP_ThirdPersonCharacter, how would I get that "health" variable when it return a player controller ?
Get Pawn
huh ?
I have my own question. Can clients spawn actors in their own instance? And if so, would a server rpc not work on it because the server doesn't have a copy?
- Yes
- Correct
should I cast it first to my creatd Player Controller ?
No. Controller's entire purpose is to possess pawns. So all controllers have this method
Where do you create the widget? If you are doing it in your character bp, then simply pass the character to the widget when you construct it
No need to cast
Thanks. Hope that solves the issue I've been having
Don't need to do this. It is redundant.
Then I have an issue because the node "GetOwningPlayer" doesn't have the "GetPawn" method
Then maybe it's called controlled pawn or something like that
But AController has a reference to the pawn it is possessing and you will be able to get that
and I have to cast it to my BP_ThirdPersonCharacter, right ?
The result, yes. Because that's where your Health variable lives
All of these exist as options
So you can do Get Owning Player Pawn and then cast to your pawn.
I'm having an issue where I'm trying to attach an actor to the player pawn when a level loads. I'm using the possessed event and the listen-server fails to attach it although the client has no issue. (all actors involved are valid at the time)... if I place a delay then the attachment works... any idea what event I should be using instead of pawn possession?
Still the same issue π¦
@vagrant grail how do you reduce the health?
How do you know that all actors are valid at the time? Delay causing it to work often says otherwise
{
if (IsValid(ShipComponent)) {
if (ShipComponent->CanAttachTo(this)) {
ShipComponents.Add(ShipComponent);
Mass += ShipComponent->Mass;
ShipComponent->AttachToActor(this, FAttachmentTransformRules(EAttachmentRule::KeepWorld, true));
ShipComponent->SetAttachedState(true);
RecalculateCapsuleSize();
return true;
}
}
return false;
}```this is my pawn method that attaches it, the ShipComponent actor is valid and the method returns true
I'm assuming the pawn is valid since it's the one that is calling the method...
I'm using the "PainCausingVolume" given by default by Epic, and detect when damage is received on the player and use that to decrease health
When does the ShipComponent get created?
immediately before calling AddShipComponent (using possessed event on server)
Show updated code please
Which part fails on the listen server? Do you have an exact line? A log anywhere? A failure message?
If I call "Get Attach Parent Actor" immediately afterwards on the attached actor "ship component" I get null for the listen-server but a valid reference for the client. If I add the delay both have a valid reference. I only started looking into this because I was setting the location of the pawn and the supposedly attached actor wasn't following for the listen-server pawn.
I'm not sure how else I could check the result of AttachToActor
Where are you creating this widget?
I guess it has a bool return DOH. Going to log it brb
In the Player Controller
Okay. So you're having the exact same issue as before because you're giving it the exact same controller.
So, you can go about this a few ways
- Have the health on the playerstate and when the playerstate's health updates, update the widget.
- Pass in a reference to the character when creating the widget (what ColdSummer suggested before) and update the widget when the character's health updates
You won't be able to rely on the UMG player controller stuff because well...other client's player controllers don't exist on the local machine (unless server).
I swear to god I added 1 line of logging, closed editor, built, restarted and now it returns true and attaches without issue
That's going to haunt me though lol
Just Unreal thingsβ’οΈ
Wait my bad, that was the HUD not the widget above my head, the one above my head I don't add it through code but rather I have a "Widget" component on my BP_ThirdPersonCharacter, and assign the class "WB_HealthPlate".
@vagrant grail I would follow Duroxxigar advice in regards to player state,
But this is a very simplistic way of doing it (Don't even know if I'm doing bad practice, just a newbie who are struggling with mp)
I've honestly never used the widget component, so don't know specifics about it. I often go for minimal UI π
argh π¬
should footstep sfx be on the client and then server -> multicasted to other clients?
Nah, just play it locally on each machine?
doesn't really make much sense to do any rpc either, there is ping remember.
When the server version of their character plant the foot on the floor, it doesn't mean it's the case for your machine
Yeah this is redundant, I don't even need to set the owning player and it still work
yea, that's kinda what i was thinking but i guess im not sure how other clients would hear the sfx if i do it only on the client?
each machine will hear foot step when the characters in their machine plant their foot on the ground period
you don't have to think about multiplayer at all in this case imo
yea i might be overthinking it, i just wasn't sure how other clients would hear my characters footsteps for example
you are still thingking multiplayer tho, in your world, other player will move around yeah?
yes
everytime a character plant their feet it play sound, that's it
no need to communicate it with anyone
that sound just spawns and i hear it?
tldr, just play sound when ur foot plants on the floor
no matter what? there's no real way for me to test by myself
lol that's wha ti have but im just not sure how other players would hear those sfx but i'll take your word for it
i simply have a notify event no replication just spawning the sfx
PIE lets you spawn multiple clients
yup, no replication required at all
in editor
and other clients will hear these
yea i know but the footsteps are like split second long so switching to check if i can hear the other players footsteps is hard
sure, the instruction is to play sound everytime a foot is planted.
so anyone please ? π
gave you the code already and it work for me
i guess i just didn't think that sound is actually spawning in the world, considering the multipalyer aspect. really thought it was only happening on that clients machine and no one elses
Each machine simulate their own character. You don't even need to spawn anything, just use play sound notify in the animation
But in my case the Widget isn't Created as it's just assigned in the Widget Component on my player π¬
don't matter
right but i dont simluate your character
huh ? So where do I put the "owning player" input then ?
Each machine will have their own version of the characters
so the server is already replicating it? that's how i can ease my mind to think about it lol
There's no replication
so i wont hear your footsteps ?
I'm trying to pickup a gun and then spawn it and attach it to socket. Idk why it's invalid.
you will hear a foot step whenever a character in your machine, in your world. Plant their foot on the floor.
the image is already done. The other thing I can't do that, I don't know how to explain better because I'm not using the node "Create Widget" because I'm using the Widget Component attached to my player (so it's not through scripting) π
@vagrant grail that's fine, as long you have an instance of the widget in the world
do you actually still have issue with the health?
this is fine, it will still try to get the player health if you do this #multiplayer message
print string to be sure
yes
im confused why tho. it kind of goes against what i already understand. if i do something on client, other clients won't see it/hear it if i do the event just regularly , no replication
The server has the right value, but the client not
how do you print it?
it's sync on mine
Something interesting in the tooltip of the "Get Owning Player Pawn"
@vagrant grail should work in listen server
even if u play stand alone, u are playing as clients anyway so it should work regardless
not sure how you set the variables on your end, you can try this to test
in listen server it's even worse, the client doesn't have a character and the health above the head doesn't show up fort the other player
thx π
Any help pls
wait, where is your code ?
just relaized something, sec
@vagrant grail
using widget component
don't think it's a good idea to check if it's valid right away.
I would probably use rep_notify for the Spawned item for the logic after setting it
Doesn't work on my side, the number on the widget doesn't even show up
Show your entire character begin play
too long
at least where you are setting the owner
ok I don't know what goes on the left side
but move it all the way to the start of the begin play
then let me know, gonna sleep soon
Yup that's a problem already
why ?
@vagrant grail this logic is run on every character in the world, for character that you don't own, you are not gonna pass the GetController check because the character you don't own, don't have a controller
so u end up never calling the Set owner logic
Move it all the way to start of the begin play to set the owner then it should work
Also, I'm not sure if I should use for that case a multicast reliable or not
Like so ?
But in that function i set item object how is passed in a parameter.
imo there's almost little use of Multicast , I watched a podcast from someone that have shipped a game. He said he have 0 multicast in his game
And then i return spawned item
Multicast RPC only run on clients that is currently in the game
so if there is late joiner, they are guaranteed to be desny
say u play a montage using multicast, late joiners cant see other character dance
yes, like that
Yes but not only that, a Multicast is run only if the player is in the "Relevancy Settings", that means if you Multicast but the other player is on the other side accross the map he won't receive it
problem is, I intend to run the onrepnotify that changes the weapon attachment upon replicated montage (draw/switch)
and most examples I've seen use a multicast to play the montage, maybe that's not the best approach
there are number of condition here multicast rpc will get dropped, one being relevancy
it's working for now, but I'm wondering when players are not network relevant
Don't know what example you seen
yeah
can't say I understand multiplayer, on the brink of giving up tbh. Too hardβ’, but if it consolidate something, Epic use Repnotify to play montage pretty sure on GameplayAbilitySystem
The strangest thing is that at first it doesn't work but then it does.
Yea I don't know what's what on your end. But if that logic run on client, they probably get accessed none because it takes time for the replicated value to reach them
you might get away if u don't simulate lag, but that doesn't say much in a real environment
always test with some lag when doing multiplayer
So.. what can i do?
Problem solved ! But I have another issue, which the damage volume applies damage only to the player hosting the game and not the other player, is that because I used the HasAuthority node to receive the damage detection to decrease health ?
open console Netemulation.pktlag 150 to test with lag
Still the same
u want to damage only on the server anyway
but why isn't it damage the "Client" ?
it will if u do it correctly
what did I do wrong ?
the last pic I sent, this will let the server start a timer that damage every actor in the box volume
but I'm using the PainVolume provided by Epic
I know nothing about that
never used it
but most likely the issue is how you set the health value, just my guess
anyway for something like a pain volume, the client doesn't need to do anything
the server will check on it's end, if any player is inside the pain box
and set the health to any actor on it's end, which will replicate the value to the client
doesn't say much, and u dont need server RPC
simply let server set the health
client don't have any business here
the event is "Execute on Server"
redundant
? huh
Something like this would suffice
no RPC needed
RPC for?
we don't need the client to report to the server that it's health is reduced
The server does the check here
whenever a character enter the pain box in the server machine, the server will set the health value which will replicate to client (eventually, the time depends on ping)
I test it. Everything remains the same as before
I mean, adding lag won't solve your issue if anything it's making it more complicated but you kinda have to get it to work under this environment
so an RPC could be called by the client even if I don't have any code in my whole project calling that Server Event "Execute on Server" ?
Got it. So u don't know how can i solve this issue?
I'm trash coder who have yet work on equipment system, especially in multiplayer. I woduln't know how to fix your problem, sorry
Np, thx for ur help!!
my guess is that it might not be valid on client
try to play on listen server only, see if u get not valid still
I'll try!! Thank's
not sure what you mean but for a pain volume, no RPC is needed
- Server Checks if there is characters inside the pain volume every second
- Server deduct all the health variable of characters inside the box
- Health variable will be replicated to clients
Server RPC is the only way for client to communicate with the server. which in this case adds nothing to the logic
Changed the events from "Execute on Server" to Non Replicated, and in the Event detection, I used switched Has Authority to call the Decrease Health event. But still same issue π¬
This fixed it. I play another func in server too and works. Thx
Well I mean, that doesn't neccessarily fix it. If you need the item to be valid in client, then you would have problem
most of the time, I would use Rep_notify to do stuff
Like when server replicate a weapon value to the client, the client then can do the logic on rep_notify. attachment, cosmetic, etc
Let's see that tomorrow I will go to sleep too. Thanks for your big help today π
Not sure about pain volume from epic, i wrote the code to reduce health every second #multiplayer message
I will try that tomorrow, thx π
https://gyazo.com/33aba971b33918ae0c41d7dcc0265b88
Hey Guys this is the problem as usual this is on the client end "my friend playing" he lives close by with greate internet/cpu What could be causing this ?
listen server
anonye :/
@queen escarp getting rubber banded, seems like the movement is not in sync with server
you get that effect when trying to sprint on blueprint
hey guys I'm trying to synchronize a day night cycle using the sun position plugin.
Any reason why this logic wouldnt work? My solar time is always 1 hour behind on client side
this is the solar time update function in the daynight blueprint
@dark parcelbut really do u have this problem ? i always have this problem with all my projects
I had that problem when I tried to sprint using blueprint. Discovered it's not doable there and haven't encounter rubber banding soo far
tested with friend accross continent
imo ur issue is you are setting Speed somewhere but the client and server are not in sync with the speed
You are trying to run faster than what the server think you should be running
hence the correction
that makes sense im gonna check that right away
acctualy im not setting the speed anywhere
except in the CMC...
should the cmc be replicated ?
Hi all!
I'm trying to understand simple replication,
and i've been up for 6 hours more than i should've been trying to figure out why this crashes client (or disconnects the client from the host server)
this is basically the only change i've made iirc to the starter content BP_Weapon_Component Blueprint.
(The print Text function i've been using to check things, goes from listing the source as the server and client to just general, so that's what makes me think the server crashes)
I've made the projectile itself replicate from the server, just for testing purposes, and ideally want the projectile to come from the server. But any attempt to replicate to server in the BP_Weapon_Component ,seems to crash the client when it attempts to replicate (and if i set run on server as reliable, it crashes UE5 completely. and going from run on server to multicast doesn't work either lmao.).
If time is set in determistic way then you can just sync it once and maybe run a check every now and then to make sure they are in sync
Client can do a server rpc and get the time from the server
Time is set as a function of event tick. I'm not sure if that is deterministic. I have solar time updated in a timeline contained in the daynight cycle blueprint. I'm trying to check to see if the client is out of sync with the server when the timeline starts/completes. I'm not sure why this logic doesnt work
Depends how time is incremeneted. I dont know what goes on your end but if each machine run their own logic to increment the time and its determistic (no random stuff for example) then client can just ask the server at the start of the game, for the server time. Then the client can proceed running its own code to set the time
@fair latch any more ideas wjat could be causing it :/ ?
Nope, sorry. Default template works fine for me. No rubber banding
are u replicating the CMC ?
You said you set the speed in cmc, how do you do it?
I think its already replicated by default. I dont remember ticking any box
Changing the default values is fine
Its not what cause ur rubber band
No idea at this point
What do u want? Replicate speed?
this is the issue im having
and im using the default "add movement input" to replicate the moving
this is on client playing
Are u sprinting?
no
O just walking
Show me ur code
[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxNetTickRate=30
NetServerMaxTickRate=30
LanServerMaxTickRate=30
NetClientTicksPerSecond=30
bClampListenServerTickRates=true
MaxClientRate=50000
MaxInternetClientRate=50000
[/Script/Engine.Player]
ConfiguredInternetSpeed=500000
ConfiguredLanSpeed=500000
[/Script/Engine.GameNetworkManager]
TotalNetBandwidth=600000
MaxDynamicBandwidth=100000
MinDynamicBandwidth=5000
this is what ive added in the defaultEngine
stuff i got from Google but cant say if its helping anything weird ?
Mmm
im replicating the "Mesh & CapsulComponent" not The Cmc
If u start a new project whithout that?
same
?
y
yepp
all
none of you guys have this problem ?
are your movement on listen server running smoothly ?
U checked replicate on mesh?
ye
Componen replication?
y
And only check this ones
but that will mess with many of my other systems :/
since im changing collision box settings etcetc ?
Try it
ok i will
Has anyone had issues with disabling character movement replication on event using SetReplicatingMovement(false) ? When I do it in BeginPlay, all is ok, animations play correctly, but when I call it from an event in middle of the game, server animations completely stop, and client animations are too fast
huh ?
Uncheck component replication on that components
And check replicates and replicates movement on playercharacterparent
Wait.. that charactes is a child?
yeah
Go to his parent
yeah i know
Should Weapon Attach and Detach from player be MultiCast RPC from server ?
Mine works properly for the first time attaching
But trying to attach after detachment if not working
Code
@rain condor gah now im having some other o#issue with client controller not being possessedβ¦ gah ill have to look at it tomorrow ty for help tou might se me tomorrow asking again π π
But jittering walk it's fixed?
How can i set character references for a passenger vehicle. I play animations for getting in & out but the animations can only reference one character at a time
I never did figure out the lan if youre still interested lol
I've got LAN working fine now. It was just that I hadn't ticked 'Should Advertise' Seems silly that the plugin doesn't treat Should Advertise as 'true' by default when using LAN (because seriously, who's hosting invite only games on LAN), but whatever.
you managed to find yourself using the online steam subsystem without another computer?
Has anyone found a fix or good work around for UE-169798? (https://issues.unrealengine.com/issue/UE-169798)
Would the best sollution be to shut down the voice engine until all players have connected on the next map?
Just looking at the Callstack in the report, seems to me like whatever Actor owns the SynthComponent responsible for the VOIP is being cleaned up during the level transition and thus causing the crash.
This is likely why its marked as "Wont Fix".
Because its not an Engine issue, its a, not understanding Actor lifecycle for Level Transition issue of the users.
Seems to me like the Actor needs to be marked for being retained during travel would fix the issue.
IE: Add it to the seamless travel actor list.
The VOIP talker is currently on my player pawn, because it was an easy place to bind OnRep_PlayerState so I always knew the playerstate was valid when registering the it with a the VOIP system. Do you suggest moving it to the PlayerState then? Those are persisted by default, right? Ive heard so much conflicting info with seamless travel so forgive my ambiguity.
Putting it on the Pawn would mean that its destroyed during Travel
As the Pawns are not retained.
I figure an easier approach is cleaning up the array of RemoteTalkers so the AudioEngine doesnt try to play anyones voip during travel
right
You would honestly be better off creating a dedicated Actor for it instead.
Which you add to the seamlesstravelactor list
I wouldnt tie it to the PlayerState
As that can be replaced as well.
It is retained during a travel, but can be recreated
yeah that sounds like the best solution but when using a positional audio system, id imagine it would be an awkward cut from spatialized to non spatialized when seamless traveling
How would you spatialize it during a travel?
Also, the intention would be that the dedicated Actor would be attached to another Actor
well yeah you wouldnt, so you go from hearing some on, say, your right then during travel they are right in your ear
In order for it to Spatialize
It would follow whatever the intended "Source" is
IE: the Pawn
That decouples it from the lifetime of the Pawn, while also retaining any spatialization support.
Yeah I know it will persist just fine and work on the next map, i was just referering to the split second of non spatialized audio when all the voip actors are bunched up in the transition map
because afaik, the audio system stays live during seamless travel, which is what causes this crash
anyone able to help me understand game instance can i have a host local and a dedicated together in one Instance?
i appriciate the help though :) im going to attempt the remote talker clearing idea first, and if that doesnt work, ill go with your idea
im using steam advanced sessions that i want to use for coop and I want to have dedicated as well
this all works as intended
this is what i want to occur to i just buld the client first without the init and the build the server with the init?
Any help pls
Hello, is there any info / graph that shows the replication order for base classes?
if not, is this order correct?
Game Mode > Game State > Player State > Player Controller > Pawns (?)
Hello, anyone willing to help me out. I have advanced session steam setup. I can find the sessions, but fail to join sessions.
This question might be more general than multiplayer, but whatβs the best approach for handling first person (arms/weapon) while displaying third person models to replicated clients ?
Do you have both third person and first person meshes on a player and hide third person for the local player ?
@sterile prism do you have them in standalone in the same editor?
and do you have it as listen server?
I have it as standalone on two separate pcs.
I am ignorant on opening ports
you will have to look up how to open your ports with your router
No, thats not what it looks like to me.
Its the fact that whatever Actor the Audio is attached to is being destroyed during travel which causes the crash.
Thats my assumption based on what Ive seen in the report.
If I had a friend play at a different location, would it work?
But if that isnt the case I am happy to accept that.
if you have a internet service provider look up how to open ports with that company and if or you havesay an asus router look up how to open the ports for that you still need to allow the traffic to flow in and out of your home
Advanced Steam Session doesn't require to open your ports - mines aren't open and it worked on both lan and over steam network (tested with a friend)
Other common issues are:
- Check the steam app id (make sure you use the test one)
- Make sure you build your game for Development if you're using the steam dev app
^^^\
building it right now. Found this answer on forems. So we will see
if he can see the server tho it wouldnt let him create the server tho will it?
like if his steam app id isnt set up
im really new at this as well im trying to get dedicated as well as steam going at the same time lol
https://forums.unrealengine.com/t/advanced-session-lobby-findable-but-cant-join/567072 This dude had the same issue. Was able to create sessions & find sessions. Wasn't able to join them until he built it in development.
Hello guys, Iβm currently trying to implement a multiplayer functionality with the Advanced Sessions plugin on UE5.0.2. A player can create a game, which can be found and joined through a server list by another player. The problem is that, while games can be found, I canβt join it for some reason. Iβm running the game on two different machines ...
try that
you're right, so is most likely the second issue I listed above (same as in the solution from that forum post)
yah neat i never knew that about development and shipping but makes sense now that aI read it
I remember doing this years ago and it was so much easier. What happened unreal..
i just started last january never touched it before lol
so i have no reference of whats good or bad
Welcome to the grind
when it comes to anything online. things naturally get harder to do/features are taken away as a result of someone somewhere always finding a way to abuse it
remember the good old days of net 2.0 when almost every service online had free API's to almost everything
bro you aging yourself
I'm barely 25 :(
Game design is rewarding when you get things working. It can be really frustrating working with a team though that wants to go in 9 different directions
yah when your done your build lemme know if that worked thow it in the old memory bank
still cookin packages
here's the full stack trace / thread dump. Its caused on the audio thread. It seems like the voice engine is trying to route audio to a component that doesnt exists like you said.
https://triiodide-studios.sentry.io/share/issue/04c0ad0bb3b94366ab43f4857fd6d4fa/
Fatal Error: EXCEPTION_ACCESS_VIOLATION_READ / 0x411000001f8 AudioDevice.cpp FAudioDevice::StopSoundsUsingResource
So I would be curious then, that if the component was on an Actor that can transition a Seamless Travel, if that removes the issue.
I storing state change function on notify in montages, and play those montage on GA. However those notifies are not predicted by GAS, as print not syncing in the server window, and it cause bug like stuck in Chained state, those bugs never happen on the server.
Can i solve this with GAS prediction somehow or i have to make my own?
Would be better to ask in the #gameplay-ability-system channel?
probably, havent had a chance to test if my other method will work
It worked. Both PCs were able to join. Thank you @nimble sky & @kindred cypress
I can finally sleep now. Wasn't going to bed until this thing was done.
I always just ask for help here, but I'm glad I could finally help someone else 
Now on to replicating all the events in the game. Oh boy.
thats always fun
Can't replicate inventory refresh
Sorry for the ping, but I got around to test my idea. Shutting down the module. Didnt work. Your idea is indeed the best (or only!) solution. One question I had with the persistent actors because Ive never really worked with them, how would you associate a voip actor with a certain player after traveling? Because they need to be registered with a player state and attached to the mesh of the character, how do you know which VOIP actor belongs to which player? You cant rely on Controller of PS refs... maybe net ID or steam id? Net ID would have issues and steam ID feels too hacky. Is there something im missing?
UniqueNetId from the OSS would be a normal way to identify a unique player.
is there any advantage on putting inventory on PlayerState over PlayerCharacter
Since they are both exist on client and server
I kinda prefer PlayerCharacter because it's closer to mesh and everything
And bind Enhanced Input stuff too
hello do you guys concern about Bandwidth? Back in the days(like 6 years ago) we aimed to 1Mbps at max. Now we're about to start a new multiplayer title so I wonder whether the number changed. Or no body takes care any longer since most of players have 1000+ GBps π connection?
Persistence would be one
CPU overhead is a bigger concern.
Network code needs to be performant more so than the packet size its producing.
Why does it need to be on the PlayerState even?
PlayerController would be even better.
Assuming you dont want other Players to have access to all your Inventory information.
You can always replicate a minimal list of stuff to everyone that might exist in an Inventory for visualization. For example, Armor on a Character.
i wasn't worry about those stuff, more like do they functioning the same when being replicated
Anyway, i was thinking, if Player A have 200ms, and Player B also have 200ms, when A moves, it would take 400ms for B to see that, right?
Then when A attack on the server, A not actually attacking B but more like the past version of B
So on A machine it's like using the future version of self to attack the past version of other players
@rain condor no jittering walk aint fixed *
@rain condor hm i think it got better when i did your change but it seems like the jittering is on the server side now "the host sees everyone jittering instead"
I wrote my own Damage Volume and now it works properly, thanks π
ICYMI, Mover 2.0 is in the 5.4 branch now: https://github.com/EpicGames/UnrealEngine/commit/a4b2f5ec21a25f5b2bcf65176d3d48bff9e1e497
and it is using NPP afterall
Why is something as simple as pushing a simulating sphere around causing so many corrections, how do people deal with that stuff?
hey have this look around system where i rotate the character but doing that in a RPC is bad since its super glitchy
what should i use instead+
add controller yaw input is already replicated right or ?
add movement input is replicated but it dosent rotate just move towards direction
Stop using multicast for something like that
A replicated value is enough
For rotation you can interp to replicated variable on tick
For clients use server rpc to update the variable
is tick a good way really :/
Afaik control rotation is already replicated
I dont know a better way, it seems to me its only logical to interp on tick to incoming values and soo far i see ppl doing the exact same thing
the "Add Controller Yaw Input" is already replicated as u said thats the one i wanted to use tho
Im newbie but gotta say its bad
I could be wrong but i dont think so
Something like movement u have to set the values very often
yeah
Since clients cant update fast enough
It just need to interp so u dont get snappy result (on proxies)
Multicast is terrible most of the time and for this case its probably take the cake imo
A replicated variable sufficem. Client will interp to the values the server send on tick
Control rotation is already replicated i think, if thats what you need
So u can interp to that on characters u dont own. I think they r called proxy not sure
aye i get what your saying i will try to mess around with that to find a proper solution
your way makes more sense
altho i think i fixed the rubberbanding stuff, but a new problem merged
left (Server) right (client)
now theyre slower on the client side or more jittering
it dosent even take the same amount of footsteps
its like all clients on server are in slow mo
OMGGGG..
just saw it at a glance and it loom pretty good
i wonder how it compare to CMC
@fair latch i need to change bOnlyAllowAutonomousTickPose to false
edit: to set bOnlyAllowAutonomousTickPose to false, you need to override ACharacter's OnPossess because that is where it sets it to true.
is that something you could help me with whenever you got a few mins over =)?
U can follow the instruction from that reddit post
Its not a 100% fix
When playing montage u have to switch it off or u get all sort of problem
Only true fix is dedicated server afaik. Or something else that i dont know
Thats the bandage im applying atm anyway
ok but worth to try ? i mean its a simple change i suppose if u know where ?
dedicated server ?
i did that on my last project but the 100+gig extra space is a real hassle in my case :/
Read the post, u have to override some stuff. I think in move autonomous you need to set the charactertickpose or something like that cant remember
Cant really help you more than the article
Btw if ur character jitter in pie thats probably not the issue to begin with
The jitter the article mentioned happend in packaged build as a listen server
@queen escarp someone mentioned move2.0, i think that will be the new character movement component. Probably address the jitter issue. One can only hope
aye that would be a big improve
I have an issue with the name plates, going through each other when I'm at mid to far distance but too spread when close. How to have 1 consistant distance ?
I want it to be like this all the time
Easy mode would be to make them the same widget
Add a vertical box
Add the name first then the health
Smart, and what about the scaling on the distance ?
Epic should add an option for the scaling so we don't have to code it
@vagrant grail #blueprint message
Dont know how others do it
Thx i will check that. Also I don't think in minecraft they used "Screen space" over "World Space" as otherwise I would be able to see the whole name and not being cut like this .
But it makes me wondering, how did they achieve the fact that we're able to see names through walls tho π€
Dunnoe, with good understanding of math and rendering you can probably do a lot of things. Im just a school drop out, gotta take the imperfection till i understand a better solution
I just scale and fire a trace. If something block the trace, hide the widget
But I want the ability to see it through walls like the images above
Is Doreplifetime still used in ue5?
Add the widget itself to your character BP that's one way to do it.. Don't know if its the "Best" or appropriate way to do it.
Can also mess with the screen space and world space..
Then just do nothing, it will show up regardless of the wall
Screen space
But in screenspace it creates the problem of having the UI widget always in front which gives this issue where when I'm in front of another character his name is still showing up inside of being hidden by my body like in Minecraft
Already the case buddy
Trace from the camera to the widget location
Then check if it get blocked by a character
Which if thats the case, set the widget to be invisible
how to get the other player widget location ? Because if I use the widget reference, I guess it will take my widget (above my head) rather than ohter players widget ?
Each widget will run the logic
The logic being a ray trace from player camera to self ( the widget comp )
comp ?
oh component
Component
so I have to write that code in the widget component itself rather than the BP_Character ?
Ye do it on the widget, keep dependency one way. The character doesnt need to know or deal with the widget. Widget handle the widget logic from it self
it doesn't work π¦
I am thinking again, which one is the purpose of prediction? Is it to sync the exact time between the server and the client, or to accept the delay and make behaviours happened similarly?
Let's say player A have 2s ping (2000ms)
A try to play an attack animation that last 5s, and use client prediction to play it on himself. At 00:00 A play the attack, but up until 00:02 the server received the command. What is the job of the server here?
1 - The server try to guess the delay and play the attack animation at 5 - 2 = 00:03. The animation will only last 3s on the server.
2 - The server just play the animation as they receive it, with full 5s. But if it behave like this, what is the point of client prediction anyway, since the real animation is not played yet..? So the client rather tried to simulate the delay so it would feel more real?
I don't understand how multiplayer games work, it all feel like some illusion. Is there any video that explain this?
Well, it really make sense when i write about it, like for an animation last 5s, the server can predict and roll to the future, but for spamming switching movement, there is no way to roll to future, so i guess it's option 2? But i still want some confirmation.
Why is there rpc? And why do u need a ref to active camera?
Just get the player camera manager
because I can switch my camera between FPS and TPS, so I have to camera and I need to know which one is active without trying to get the camera on Tick.
It looks like "Tick" is not even running for the WB_Nameplate, what could be the reason ? π€
Get player camera manager should return w.e camera u have
And dont think about multiplayer here
There is nothing that required rpc or replication
Client prediction is done to make a smoother gameplay. Say u have 100 ping and u fire a gun. If u have no prediction and u have to wait some time before the ammo count drops, that do make it a very unpleasant experience
Character movement component is another example
U get to move your character without waiting approval from the server
With no prediction u will start moving after a second if u have high ping
Thats not playable at all
so short question, the server don't predict, only the client?
Ye
Another simple example is probably toggling a flashlight
If u dont care about cheating just do the check on client side, and toggle the flashlight right away while telling the server that the flashlight is toggled
Point is u dont want to wait for server to comeback to you because without prediction ping gonna ruin gameplay experience
I have 2 options "Get Owning Player Camera Manager" and "Get Player Camera Manager" which one should I choose ? And also getting one or the other, I can't find in them "Get Current Camera" or"Get Active Camera", so what should I look for ?
@twin juniper you can do client prediction for the montage and play sfx right away but the damage check should still be on server
Doing something like an attack in multiplayer is not easy. You prob should send a data to the server with time stamp then server will simulate thst data on their end and check if its valid
Some keywords to look for is probably network clock, client prediction, server reconciliation
Yeah, i understand client prediction, but if the server have 0 prediction, we are basically trying to control delayed dummies and fight with each other on the server. That imagination surprise me a bit
I dont see any relation with prediction and the server
Server is the truth
It also has no ping
@twin juniper u can check stephen ulbardi multiplayer shooter if u want. It goes over client prediction and server reconciliation
W.e gets you the player camera.
udemy courses are incredibly long lol. I had some, now i prefer just testing stuff myself or watching youtube videos
U can watch only the part that you need
huh ?
But there is also free option, which is to read. But im no programmer and still in a stage where i need someone to hand hold me
The course is valuable to me but not for the big brain ppl around here
I think we need to solve the issue of why Tick isn't called first, what could be the reason ?
The instance of that class doesnt exist in the world
Or tick is disabled
The Widget Component on the player has the WB_Nameplate as the class, so does that not generate an instance of that class ?
Tick is definitly enabled
Ye it should, if the player character get spawned. Print string on construct and on tick in the widget
Construct was printed by the Server and the Client. But Tick was printed only by the client (I guess it's because WBP are Client Only which makes sense) however it pritned only once instead of spamming the print as Tick should do
Do you add key in your print string maybe?
what do you mean ?
Make sure the key is None in print string
what "key" ?
Check your print string
Oh "key" is set to "None" already
Well i have no idea then
Somehow when I switch from Screen Space to World Space, the tick fires again properly
nevermind it only fire 4 times
I wanna refresh inventory without close/open inventory. I replicated it this inventory
Solved the issue but as expected it's hiding the Widget above my head rather than other players widget π¬
You should brain storm, everything should be on paper before u do it in unreal
If you dont want to hide the widget on top of the player that u are controlling, then make that happend
You can start using plain english for the algorithm or rules
but that's the difficult part, as how to hide other player nameplate being behind the wall without hiding other players that are in front of me
U r only hiding the widget wdyn by hiding other player
Is there way to migrate server after listenserver quits ?
wdyn ?
Every widget will do a trace except the widget thst is owned by the local player ( if thats what u wish )
There is something in marketplace that gives off that effect to certain extend
But i personally wont do it. Not worth the time as a small team dev
Yep, but it wound suck if server quit before game finished
Indeed but it is what it is π
Maybe i need way to transfer autosaves to client ?
You can always check marketplace, i cant remember the nane
I have a question, is there a way to make the Widget on the head being set to "World" and have something (that's the part I'm looking for) that makes that widget always render in front of the camera but always behind the player ?
Im not the right person to ask. Its possible sure but i dont know how. Hell i cant even get world space to render a text decently
argh π¬ Yeah we're on the same struggle buddy π
The struggle continues
I will ask the shader gurus maybe they know :p
And multiplayer amplifier the struggle
Are there any differences between saving singleplayer and listen server?
Your game your design
Hey there guys, what do you consider the best strategy to replicate weapon switching? I mean, the montage itself
Using repnotify? Multicast? Just AnimBP?
Iβve been trying some stuff but not really sure about a reliable approach to chain montage properly, like put weapon back socket, grab new weapon to hand socket montages in sequence
is there any reason why I should use apply damage over a custom blueprint interface where I can customize it even more?
When 5.4 supposed to release?
Hey, I'm setting up replication for the First Person template and for some reason EnhancedInput.InputAction /Game/FirstPerson/Input/Actions/IA_Shoot.IA_Shoot fires twice on the remote clients. Would anyone happen to know why? Works fine on the listen server, and still fires 2 times when there are three players in the server
not saying I can help but you get more chance of getting help by others if you show your code
Fair point lol, screenshotting it atm
these are both the results of a "single mouse click"
if u just want to fire once, I think use Started
Event still fires twice, even with Started
doesn't explain why the client fire more than the server tho
only fire once to me
both on server and client
I wouldn't handle input inside weapon component
but don't quote me on that, I don't know any better
Yeah, I plan on changing it asap, this is just how the default template was setup
π
Triggered runs every frame so multiple fires are expected.
Use Pressed and Release
Pressed fires only once when pressed and relased fires once when your release the button
It's perfect for Weapon firing.
You can start the fire in pressed and stop it in released. Works perfect automatic weapons too
imo every multiplayer FPS game use timer for automatic fire
Refactoring out of the component did fix it
Which might mean there's another underlying problem
the component is replicated?
input have nothing to do with replication imo
it's just what every machine execute locally
I guess I may need to modify the pickup bp, standard one w replication seems to attach the component multiple times
yeah I was thinking one exists on your client only and the other is server replicated
How do you add the component
came accross youtube tutorial today that Spawn using multicast π€’
and everyone was thanking him for covering replication
a lot of victims it seems
π
lmao
funny enough, i didn't even change the pickup code
(I mean, I did add a Print String)
add switch has authority and execute this on authority only
When I remove an actor from the world using a destroy actor, I just have to replicate it on the server, right?
wdym by that
Handle destroy and spawn in server only imo
Okay, I suppose that's because collision get's called on both server and client?
if its replicated and spawned by server, a server destroy event will do that yeah
If an actor is marked as replicated, if you spawn it on server, client will get a copy of that
yup
Ok, that's what I assumed, I did it that way, but the clients still see the object even after it was destroyed by the server, do I have to consider something?
Unless it's cosmetic object that can just exist on client, imo handle the spawn and destroy on server side only
Fixed it. Thanks!
How do u spawn the object?
For now, I just drag it to the map, but then it will be dropped by enemies on the server side
just an example on how to destroy an actor marked as replicated that you drop in the level
Hmm, but I handle it in a different way, I have a line trace that detects the actor that is hit, that actor is passed as a reference to another component and from that component, that actor is added to the inventory, after adding to the inventory , is destroyed
But only the server sees it destroyed, the clients do not
don't matter how you handle it, as long you are destroying it on the server side
when you destroy the actor on server side, the client version will get deleted too eventually
Sure, it's what I assumed, in fact in other code it does work for me, but it's not working for me in this case
It should be replicated, otherwise the client one will not be deleted
So if you are client do a server RPC that tell the server to destroy the actor
Yeah, mentioned that
I'm sure its because you did not replicate the actor
@dark parcel Do you know which build in functions get called in server by default ?
I don't think this really has anything to do with it, but does it matter if the line trace is replicated?
I don't, i read your question in #cpp . What purpose do you need to know if I may ask
We already know that the destroy works fine, its the fact that the actor you are destroying is not replicated
To minimise server RPC calls as much as possible. I came to know yesterday that BeginPlay and OverLap are called on the server by default
I asked this question multiple times, but nobody answered
@torpid whale are those actors blueprints or just shapes?
Actors blueprints
Begin Play will fire on both server and client
can you show Class Defaults, Replications section?
and also whenever an actor become relevant
it's kinda not the place to put stuff imo
but im a newbie so I could be wrong
For my case, I handle my cosmetic in On Posses for Server
Thanks, I had that disabled
No worries lol
and On Rep Player state or Acknowledge possession for Client
Me too
You don't need switch has authority its already running on server
@vestal shale https://wizardcell.com/unreal/multiplayer-tips-and-tricks/ this cover a lot
Simple example
if you are the server just destroy the actor
if you are the client run a server RPC
the only way for Client to communicate to server is thru server RPC
how about whenever you do something print string and see where if it prints on server, server client, client only and go from there?
no release date yet
we dont even have a roadmap
Switch between has Authority node
if i wanted to have a client equip before a server event, but im using a spawned actor's info, would it be a bad idea to spawn that actor on the client before the server event? this is really just to get a client side weapon/armor etc equip , like showing the item
For whoever needs to read this:
BeginPlay, Tick, EndPlay, and Overlaps/Hits can totally call on everyone out of the box.
But you shouldn't see this as "replication". The reason Actors call these events on Server and Clients is because they CAN happen on both. This isn't really a guarantee but more a side effect.
If an Actor is spawned, during Play, on a given Player or Server, the Actor will call BeginPlay. That's a side effect. Same with EndPlay when it despawns. That can also happen multiple times per client if Relevancy changes and despawns the Actor.
Tick can call on everyone that have the instance too.
Overlaps and Hits can also call on everyone where such Overlap/Hit happens.
The important part is that it's not guaranteed, as in if the State on the Client differs from the Server, it could just not happen. And that's not a "random" thing, what I mean is that you could be having different Collision Settings on Server and Client. Or have one that has the Tick disabled through a series of events.
This is mainly a feature of the Actor Instance on your Game, which is spawned via Replication, but afterwards those events are somewhat part of the Actor's lifecycle and instance and not reaaally replication controlled anymore.
And it's totally valid to do Network Stuff on there. You can use BeginPlay, EndPlay, Tick, with SwitchHasAuthority nodes to check against Server or Client (be aware that IsLocallyControlled in Pawns and Characters is probably not gonna give a correct value on BeginPlay, as the Pawn isn't possessed yet properly on the Client as that happens "later" after spawning).
You can also totally handle Overlaps and Hits like this ,without needing any RPCs, cause you "know" it happens on everyone relevant.
That's also something that you utilize for stuff like JumpPads (stationary overlaps) knowing the Character will walk on the pad on Server and Client in the same timestamp and trigger the overlap.
There are more events that are part of the Actor lifecycle that also fall under these "rules".
You'd end up with the Item twice
The Local Version and the later Replicated one
If you can resolve that by deleting one of them, sure
yea, i guess i just keep it happening after the server event, just a bit lagged in high latent envoirment, but i guess it's semi importnat to make sure they have that weapon in the first place
this is super interesting. i have been playing with a line trace (fake gun shot) on client and server, and trying to find the best way to communicate the lag of difference between what the client is getting and the server is going to get, i.e. what the other player would experince
is it worth going and changing all my replicated bools to uint8
Pin this @thin stratus
Inside my player controller, I am adding a widget on begin play that let's players choose their team. However, when playing two players, the widget appears twice on the first players screen (but only once on the second players screen as intended).
Why is this?
Will Event BeginPlay node run every time new level is loaded ? Or just once on start?
And what if is this node inside level blueprint ?
What class are you doing this in?
PlayerController
If u have existing actors in the level, i think the engine will iterate through those actors and call begin play.
Begin play also called when you spawn an actor at run time.
In multiplayer it's also called when an actor become relevant. So if they become irrelevant then become relevant, begin play will be called more than once
I want to load new menu (different for each level). Should i do it inside level blueprint or on character ?
I actually managed to solve this now, I check if it's a local player controller and if it is I spawn the widget! π
remember that begin play will run on every character in the world.
So if there are multiple players, the begin play will run on each of the player character in your machine.
You do be making the widget 4 times if there are 4 players
The Is locally controlled check will ensure that you are on an actor that you are controlling, so it will create the widget only in the character that you controlled
Will BP_Gamemode persist when server change level ?
Connected to my system above for choosing teams, is it possible to make it that the player doesn't automatically spawn into the game when connecting to the server, but only after having had selected a team?
Because right now they spawn in and then after choosing a team I make it so they spawn again
Iβm having issues running console commands when the Net Mode is set to Play as Client (UE 5.0) but it works when Iβm playing standalone. What can I do to alleviate this issue? I figured maybe it was just a consequence of multiplayer in general, but after searching this channel, it seems like others are using console commands as normal. Itβs worth noting that Iβm working off of a template, so itβs possible they disabled something i havenβt found
By default, all functions get called everywhere
Your assumption should be that it'll run on clients and server unless indicated otherwise
not that it'll be automagically synced up, but begin play will fire locally whenever the actor begins play, doesn't matter if it's on the server or client. An overlap event will fire when the overlap begins, no matter if it's clientside or serverside.
What about custom functions ?
Non RPC ones
They get called as a consequence of their caller, whatever that might be
Can you explain a bit
if you call MyActor.DoSomething on the server, it'll DoSomething on the server. If you call it on the client, it'll do something on the client.
the default is to do the thing local
they are called LOCALLY by default, they run on all machines
You mean, they are called locally and on server simultaneously
no
local doesn't mean client
local means local to whatever machine the thing exists on
doesn't traverse or care about the network
BeginPlay will run when the actor begins play on server. It'll also run on the client when the clients version of the actor begins play (late joining, just got into relevence, just got spawned, etc)
it's fairly simple. When play begins for that actor, whatever machine it's on, Begin Play is called.
In terms of server Authoritative Actor.
It will run on server and then on client
I was host so it was seamless
Yes, you can generally rely on that order because it'll exist on server before client
Understood.
It's just a simple rule. The frame play begins on for the actor, it'll call Begin Play.
The frame an overlap happens on, it'll call OnBeginOverlap.
Each frame its tick function is ready to be fired, it'll fire.
Let's say. I am client and by input. I call a function DoSomeThing() that's not an RPC.
That function will be called only on client right ?
yes
And without RPC there's no way to call that on server from client. Right ?
yup
RPC is the only method of communication from client to server
Some RPCs are hidden, you might notice you can call Jump on a Character and it'll be networked. Character / CMC is doing that RPC under the hood
Alright. Now I wanna know the names of the functions which are run of server by default like BeginPlay and OverLap
by default they all run locally
So if on the server, something overlaps, then Overlap will be called
if on the client, something overlaps, then Overlap will be called
I got that.
Usually the 2 coincide, but there's nothing stopping you from haveing different things on server and client where one might overlap and the other not
Other than Overlap and BeginPlay which functions are called om server
all of them
How many comes in all ?
Like thousands
Sort(Most Frequently Used)
no lol
That's what I wanted to know
Are they run on server by WITH_SERVER macro ?
that's for conditional compilation
If WITH_SERVER is useful to exclude stuff from the client build such as URLs for an external database or something like that.
How does this work? Can server enable mouse remotely on client because of that parameter?
Try it, I doubt it though
Hi there!
I'm getting rubberbanding when trying to replicate a movement position using a class deriving from UCharacterMovementComponent (Unreal 4.27).
I have a Character who when jumps, should follow a Curve before freefalling.
The problem is, when I enforce a PktLag of 500, I get rubberbanding on the client.
I've tried to follow tutorials that involve sending a flag to the server using UpdateFromCompressedFlags, and then update the position inside of OnMovementUpdated.
Using log output, I have been able to verify that OnMovementUpdated is correctly calling on both client and server, but I still get rubberbanding.
Maybe I'm overridding the wrong function? I have included code samples and would really appreciate any help!!
your moves might be getting combined and messing up the simulation on the server since your CanCombineWith() is empty.. try:
bool FDogSavedMove::CanCombineWith(const FSavedMovePtr& NewMovePtr, ACharacter* Character, float MaxDelta) const {
const FDogSavedMove* NewMove = static_cast<const FDogSavedMove*>(NewMovePtr.Get());
if (SavedWantsToBeInJumpCurve != (NewMove->SavedWantsToBeInJumpCurve))
{
return false;
}
return Super::CanCombineWith(NewMovePtr, Character, MaxDelta);
}```
Oh good catch! I'll try that now
@tardy fossil No dice, I'm afraid. Same problem, but thanks for the suggestion!
yea custom prediction can be very finicky and hard to get right. one thing i found that gave me issues was setting variables I used in the compressed flags in the movement function
for example you could make another bool called CanBeInJumpCurve thats not set by UpdateFromCompressedFlags
set it to false when the jump starts and true when it finishes
somethin like
if (WantsToBeInJumpCurve && CanBeInJumpCurve) {
CanBeInJumpCurve = false;
StartJumpCurve();
}
Glad I'm not the only one who's been having difficulties!
I thought about doing that, though I did some logging during a jump and attached the result.
It seems to be going in and out of that curve just fine, though Unreal seems to think the positions don't match, and attempts to correct it.
I wondered if SafeMoveUpdatedComponent is the correct way I should be updating the position, not entirely sure π€
Ahh that's very interesting.
I guess we can't rely on the delta parameter here, and would have to use a timestamp instead?
I assumed the different timings would just be a result of different tick rates between server and client, but I guess this in itself can throw the positioning off?
Thanks for the help, will have to play around some more!
can rpcs have parameters? im having an issue where when i create an rpc without one, it works fine, but when i try to put parameters in, it starts giving me errors, and i even tried building solution to see if it was just vs being dumb but it doesn't go thrrough, any help? ill provide more if needed
What I'm trying to do:
They can have parametre, i have no issue on my end. To change material you would want rep notify, dont multicast
It gets called on all machine. Picture a box collision, each machine will have that box collision in their world. Whenever a collision occur it will trigger the overlap event on that machine (regardless server or client).
Depend on the game u can ofc can do nothing on client with switch has authority.
Imagine a pain box, you only want the server to care about the overlap. The overlap logic on client machine in this case can just be ignored (using the has authority check)
What I'm trying to do is be able to c hange the material of the default third person character, this one, so rn i'm trying to have a variable connect to that material variable and have that variable be replicated when changed
and i am trying to use an OnRep this time
@dusty void create a variable for the material. Mark it as rep notify.
If server want to change, it can just change the variable right away and then set the material.
For clients, do it onrep of the variable. Set the material to the value of the variable.
If client needs to change the material, do a server rpc that tells the server to change the variable (passing material parametre)
yeah that's what i was doing rn, the issue im coming across rn is it can't get the material through this cast since the getmaterial returns a UMaterialInterface
it passes all the other checks to get through the capsulecomponent and skeletalmesh
Why dont u use UMaterialInterface instead? I think thats what u need
yeah i just did that xd
would applyign a diff mateiral to it work the same way tho
and is the cast supposed to work or?
Dont know, im newbie. But i do use umaterialinterface to edit my character material
yeah i was realyl trying to avoid the multicast but couldn't really think of a way until i looked at the source code for the skeletalmeshcomponent
Ye dont need multicast at all
Thats the wrong way actually
Cuz multicast can get dropped
So if u for instance run this on begin play, client that join later are guaranteed to not see the material change
Ohhhhh ic
imma use the materialinterface for now
and figure out how the cast isnt' going th rough later
Now my issue is that it's not actually changing the material T_T
I even used an OnRep to see if it was detecting and it is but the material still isnt' changing for the client or the server
U never set the material btw
I mean the actual material
U only set the variable
Get your mesh component-> set material
i thought i set the material in the post login
Set the actual material , im not talking about the material variable
Yourplayerchar->mesh->setmaterial at index
U also need to change the material on the on rep for client. Do that instead printing msg only
Also i think post login only get called on server? Might be wrong here i dont do much mp but the authority check might be redundant
Yeah its in game mode. Game mode only exist on server
i got it to work just like this
i was thinking i needed a hasauthority check tho augh
Yeah u were missing set material
On rep is for clients and only get called on client
If u add authority check in on rep it prob will never go thru
Just to add from here if you need to set the material as client. You will need to run a server rpc that tell the server to change the material variable and to set material
yueah mb i just got smth confused with how pointers worked which is why i didin't set it in the onrep in the first place xd
@fair latch gonna sleep but tysm tho u helped a lot π
Hi, i have been struggling with this bug all day, can anyone help?
I played an animation with an anim notify on both client and server. But the print on the anim notify only appear 100% on the client, on the server it's 50-50.
I tried everything but nothing works, that i begin to wonder if this is a bug or a feature..?
Nvm, i figure it out. I need to change the nofify mode to some random f*cking thing called "Branching Point"
Not really "random" if you'd read the type description :P
Random in a sense it feel so hidden and appear like a random encounter in video game
Has anyone ever worked on multiplayer RTS title in UE? I wonder what is a role of player's units. Are they all simulated proxies or autonomous per client?
that i understand they are generally simulated as proxies on each client with server maintaining authority. @urban moth
second hand information, though. I'm not that knowledgeable
finally possible :)
With Mover 2.0 pawns can have all types of primitive shapes for world collision, it just worksβ’οΈ
π€©π€©π€©