#multiplayer
1 messages ยท Page 601 of 1
for example, on GameStart, if you try to access the PlayerState via the PlayerState member in Pawn, which is replicated
you're likely to get null on clients
as for the PlayerState Actor itself usually takes a while till it gets to replicate
in that case - your Pawn would have valid NetGUID to the PS, but would be unable to resolve it at the time, since the object hasn't replicated yet
Thanks for the example
OnRep still fires when the NetGUID is resolved though
@brave solar You may need to show how you're setting the bool and how you're debugging it.
Can anyone see why this lightning bolt won't appear then disappear to clients?
It is an actor in the level (so on the server.) I tried also just running Any damage straight into the print string
In both paths the bolt will not appear
the print string fires off
it fires off on the client?
Oh dang, it fires off on the server twice, wonder why it won't fire on the client, let me look at some stuff
like not checking the replicates setting?
The actor is set to replicate
I take server damage and run multicast in other parts of my game, this is what I don't like about being self taught lol. Doesn't make sense to me
does this even need to be a multicast?
I tried without
seems like something you'd do in an onrep
and maybe you want to try affecting the visibility of the MESH rather than the entire actor
and you should make sure that any default state for the actor is also valid
I tried the mesh too
that is why I went to the actor
ok, hold up, I am making a new actor
something has to be jacked up
well these things are always much easier to debug in C++, I never do anything but basic stuff in BP
but you might want to make sure the actor starts in a correct default state
I might just delete the old one. my first attempt with a blank actor, without hiding and unhiding, is showing right
I think I might have it
ffs why is this so complicated, destroy actor won't work either
things look right as far as the state it starts in to me, I have never had to setup anything special state wise where I destroy my other actors, lol
if that doesn't work, then it's probably a really dumb oversight. I would make sure this is the actual actor you placed in the level and it is replicated
I've never had issues with SetLifespan unless something else was invalidating the timer
I doubt something is invalidating it, that is the only code running in the BP right now, its definitely placed in the level
Both my new and old
well I obviously can't see everything you can, if the print string is showing then after 5 seconds, the actor should be removed from the world
if the actor takes damage again in that 5 second window, the timer will reset back to 5 seconds
Yea
ok
I have an idea
I've made some progress, got lifespan to work
but I think there is some other networking issue going on
Not really following everything that is going on for you Bogadu. But a few thoughts:
- Setting an actor to hidden on the server will actually stop it from replicating (did before 4.26 at least, don't see why it would change)
- You used a multicast RPC, not sure if you set it reliable.
- You have "NetLoadOnClient" true, and you're saying this actor is placed in the level. Unlike dynamically spawned replicated actors, this means your actor exists on the client regardless of its state on the server. If it turns off replication I believe it just sticks around on the client, and would then probably not care about anything that happens to the server version of it anymore.
So maybe an unfortunate mix of setting hidden, (which turns it non-replicating) and then the client version of the actor becoming disconnected from the server one and ignoring your RPCs?
(No guarantees, :p but maybe something like that happening?)
oh thanks, I didn't know hiding would stop replication
or the third point
I'm no expert
thanks a lot, let me play around
Basically the server assumes that your client can't possibly care about replication for the actor if it is hidden. By definition you shouldn't be able to see anything on it in that situation.
Setting an actor to hidden doesn't stop it replicating
There are other issues with having replicated level actors as well. Like the actor being tied to the lifetime of the level it is in. So if your level is unloaded from level streaming (imagine a car you placed in the level and you start driving it into the horizon) due to distance, your actor will be unloaded with it. (car go bye bye)
jambax tells me i'm wrong, i could be xD
Well how would you unhide it if that were the case ๐
I said hiding it on server would make it stop replicating to the client. So it stops sending any messages.
It still exists on the server of course.
So unhiding it on the server is no issue.
Right but if you hid it and stopped replicating, client would never get an update if you un-hid it
(either way though it doesn't stop repping when hidden)
Unhiding it would make it replicate again
when the server stops replicating an actor, if it is a dynamically spawned one, it gets destroyed on the clients.
In his case, where it is part of the level, i think it just stops listening to the server for that actor.
I made a physx bulldozer but can't figure out a simple lightning bolt lasting 3 seconds, lmao
So unhiding on server would make it start replicating again, and therefore spawn back in on the client @chrome bay
It might not be relevant anymore, but that's not the same as setting it to hidden
Ok I checked to make sure ๐ I was slightly off @limber mortar
maybe this is my problem
It's a combination of being hidden and no collision that makes it stop replicating.
{
return false;
}
the fire started 2 places when it should be 1 strike
So my bad, the is hidden probably alone is not causing your issue.
let me start function by timer a couple secondsd in
nope, still runs twice
hmm, 1 print string, 2 fires
Don't run it on tick. On the begin play, set up a timer by event.
@limber mortar
When 1 is called, it calls number 3 and does random integer of an actor from your get all actors of class. (no clue if you have more than one in your scene, but i'm guessing you do?)
When 2 is called. It will call 3 again for every time 2 is called in your for loop. All green nodes that are connected to a blue (callable) node are re-executed every time the blue node is called.
So you are probably expecting it to use the same randomized actor in the for each loop, but it's doing the randomize again. Save the randomized result to a variable and use that to avoid this.
the tick is spreading the fire throught the game
that all works right
oh i see
so save that result as a variable
got it
that explains the 2 fires
thanks
np, it's somewhat non-intuitive how that works ๐
ok
so I fixed the 2 fires starting
Now I just need to make a lightning bolt appear at the same location and remove it 4 seconds later
I have a new idea on that too
maybe instead of having the lightning bolt in the starting actor
I generate a lightning bolt from my fire control system
so after that function runs you labeled, Spawn instanced static mesh at location of start actor
like so
@winged badger Hi
So I have a struct with repnotif which is a boolean either male or female. Based on that I set some SK meshes.
In player's event play, I assign the struct from game instance to the player's repnotif variable.
Any idea why it wouldn't work
You don't get a RepNotify triggered if you set the variable to the same as the Default value of the replicated property/variable.
So maybe that?
So I have the settings in my game instance, how do I pass that to player after spwned.
I previously got it working by using swith with auth -> auth connects to multicast event and remote connects to server event
Then I called that event in begin play @unique wave
Does the setting change during gameplay? or do you just set it once in your game instance class before you start the game.
specifically, a variable doesn't replicate if it hasn't changed
if you set some variable to 0 that is already 0, for example
it wont replicate
so, what you would want to do is, on beginplay, set the skeletal mesh to whatever the variable is
and if the variable ever changes, set the skeletal mesh
do it twice
Then you are probably only setting it on the Client GameInstance.
before the game starts
also
you can make your replicated var RepNotifyAlways
which if you do somehow trigger a replication for a variable that is the same value that it was previously, it will fire the OnRep
this is becoming more common with Push Model
where do you see RepNotifyAlways
DOREPLIFETIME_CONDITION_NOTIFY(UEmpAttributeSet_Faction, Tickets, COND_None, REPNOTIFY_Always);
like that
Oh i'm using BP
then you cannot set it to repnotify always
Korvax: Sounds like you are setting the variable based on a player choice in your GameInstance. Likely on your client version of the Game Instance.
if you want other players to be able to see your choice, this needs to be replicated to the server.
One place you could make this happen is in your PlayerController class. On its BeginPlay once the game has started you can replicate to the server (RunOnServer) what the players choice was. Set it to your RepNotify variable on the server for your pawn/playercontroller.
My lobby player controller is diff than my gameplay PC
That's why I kept it in GI
Since I have two diff PC for lobby and gameplay, if they both have the same parent PC, would I be able to pass data
You can look up your GI in your gameplay PC on its beginplay @summer tide
So are you saying to store the selection settings in GI then access that from gameplay PC. I'm already doing that but accessting in my player BP
Hi, i'm New on net working and
I am a little confused
These are my questions :v
Does the character that I control on the server is the same as the client just replicated?
I mean is the same gamemode and player contoller?
But if it is, ยฟHow could I change the client appearance?(this is my main question xd)
Yes but the key here is to tell the server what your players choice was. @summer tide Otherwise no one else will get to know about your choice.
You can do it through your pawn if you want, but playercontroller is the first real player-related point you can do it. Before the pawn is even created.
Ok thanks let me try that
So I have a lobby character and gameplay character. Lobby and gameplay have their own GM and PC. In my lobby I can customize my player which updates the lobby character. THen I pass the info.
Hi, i'm New on net working and
I am a little confused
These are my questions :v
Does the character that I control on the server is the same as the client just replicated?
I mean is the same gamemode and player contoller?
But if it is, ยฟHow could I change the client appearance?(this is my main question xd)
- For simplicity sake, yes. Your character that you control on your client is the same as the character on the server, and references to your character can be thought of as such.
- No. Game mode is only part of the server and is not replicated to clients. Player controllers are clients that join into the server. Player controllers cannot interface with the Game Mode of the server.
- You need to set any variables for appearance and the like on the server, and those variables should be set to RepNotify so that a function is created and gets run when the variable replicates - you can then do any logic you need to do to set the appearance of the character based on that replicated value in that newly created function.
If you want a client to be able to control their appearance, then you need to do an RPC to the server on the player controller, then the server can handle changing whatever variable needs to change to cause the replication event, and then update the appropriate characters.
Quick question, is the default character/pawn ran on server and client?
Thanks!!! I feel better now
Hello, y'all! What NetUpdateFrequency are you using in your AI Characters?
Some context: I have AICharacters moving with CharacterMovement (AIMoveTo). Since it's a zombie game, I have lots of these actors at the same time. That said, having lower UpdateNetFrequency is giving us better network results, but sometimes clients are noticing some delays/not consistent behaviours and according to my tests, this is occurring due to the low UpdateNetFrequency I've set.
I'm quite lost on how I can overcome these issues more appropriately.
Ideas? Suggestions?
(The amount of AICharacters I have at the same time is something ranging from 50-100)
My Steam dedicated server won't allow clients that use Steam to connect. My server says:
LogSteamShared: Warning: Steam Dedicated Server API failed to initialize.
LogOnline: STEAM: [AppId: 0] Game Server API initialized 0
LogOnline: Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
LogOnline: Warning: STEAM: Steam API failed to initialize!
LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
I don't see any specific warnings to help me debug this issue. The above warnings seem pretty general, and I haven't been able to figure out the solution based off of them
LogOnline: Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
I guess you're running the game in the editor where both the server and the client are invoked.
Steam doesn't allow that at all.
If you want to test that locally you'd need to either play with a second machine or setup a virtual machine to be your host.
No, I am running the server by itself on an AWS instance
Hence the world 'could' I guess. Not sure what else would be causing this problem
you can also use the force steamclient link command line arg
to link to your steam client
Interesting, could you elaborate a bit on that?
It seems I've pretty much hit a dead end on debugging this. There aren't any good resources on these errors and what causes them. Seems like a complete mystery :\
Hello everyone,
I have been researching the available solutions to creating a party system similar to Rocket league/Borderlands/Fortnite and I just wanted to ask if I should delve deeper into Beacons or Lobbies? Considering that my aim here is for it to work on Steam
What you want is OSS.
Online subsystem?
I know how the regular session flow works (hosting/joining) etc but im talking pre-game/matchmaking parties
I switched over to the SteamSockets net driver as I wanted to have pings working on listen servers. This worked and I no longer see the 9999ms ping; however it broke the dedicated servers (complaining about "Ignoring P2P Signal, invalid connection") - I found that if I build the game with bAllowP2PPacketRelay=true, then listen server's work fine.. and if I build my windows dedicated server with bAllowP2PPacketRelay=false it still accepts connections via "FindSessions/JoinSession" and via direct IP connections.. Is this to be expected? Or am I doing something wrong here?
I use advanced sessions plugin for my steam game, and in testing, matchmaking works perfectly fine. After putting my build on steam and testing through steamworks, the matchmaking doesnt work at all. Is there any 'easy fix' to this or do i have to recreate matchmaking until it works?
OSS does that too, Please check IOnlineLobbyInterface, or IOnlibePartyInterface
None of the existing OSS's have any implementation for those
If you want a party, it's probably best to use beacons - but beacons are inherently part of the session system as well, you can't really use one and not the other
"interpolation" just means FMath::VInterpTo(CurrentLoc, ServerLoc, delta, 1.0f) right?
Well that's one way of interpolating
You should only interpolate the visual elements though
Whats the other way? You're the only one replying to pawn replication threads as I see ๐
I guess this is the CMC way then, right? Teleporting capsule and interpolating mesh to capsule on client
yeah
Only the non-owning clients though
It doesn't interpolate the player who is controlling it obviously
Since that player is predicted locally
That post is from a younger less-wiser me but it's mostly right. The player controlling the pawn has to predict it's movement locally, that's the only way to have it smooth
You can't interpolate the controlling players' pawn, that will always still result in snapping.
And jittery movement
I am using CMC on player-controlled pawns (characters) and using FloatingPawnMovement on AIs
CMC will "just work" so long as all you're doing is adding movement input
Floating Pawn Movement has no such prediction or smoothing AFAIK
Yeah it doesnt, it just teleports/corrects over time. I tried using PostNetReceiveLocationAndRotation() override and interping on Tick as I mentioned above, but didnt worked. Now I will try the mesh to capsule interpolation. Should I do it on Tick too?
the interpolation should be ticked yeah
The actual position or the object should be hard-set since you don't want collision etc. to be out of date
Then the movement component should tick, and interpolate the mesh to the capsule
CMC has a maximum smoothing distance, beyond which it will just snap anyway
Since too much interpolation can look just as crap
BTW
Projectile Movement has an implementation of smoothing now IIRC
You might be able to look at that for a super-basic example
It's not quite the same though since projectile movement is simulated locally too, and I don't think the flying movement is
Great, thanks for the guidance ๐
Hey, so I'm working on a directional gravity system, and I'm trying to figure out how to network the player's rotation. I want clientside rotation calculation with an authoritative server to verify the clients action. How would it be best to go about this? Are there any good tutorials that cover doing stuff on the client but confirming the actions on the server, and rolling back if necessary? If someone could point me in the right direction that'd be awesome!
I was saying it's party handling is handled by OSS, so if your OSS provider supports party then OSS will function and use respective interfaces
And Epic OSS will definately support that in near future
Engine do have abstract implementation done.. it's only that the OSS providers will have to write real implementation
Well the OSS provider provides the Service, but it's up to either Epic or you to fill out the abstract implementation on the engine side
The Steam OSS implementation is pretty dire, but I wouldn't count on any updates to it unless they accept huge PR's from the community. At least they're plugins now so you don't need to work from source to do so.
The abstract implementation for parties doesn't exist for steam is what I'm getting at, so you'd have to fill that out yourself. But then again Steam doesn't really have "parties" as such, you just have to leverage lobbies.
The developer or studio need to wisely choose the correct OSS provider
yep for sure
@chrome bay I wouldn't mind using sessions for the game and beacons for party making. I already have implemented a game fully using sessions and a regular Server host/join flow
the Party session?
It depends on the OSS. On Steam you can only be part of one lobby at a time IIRC (could be wrong there)
So party host would create a game session as usual, players join via beacons, then you travel with the host, then re-create the party when all players have joined
Parties are a very abstract thing
I assume it's basically sharing data without joining an actual "game session" and then being able to join the same game session
Beacons still require you to "join", it's just that they allow you to communicate before you commit to loading the level, so you can "reserve" space before joining or something
I mean you can use them in many ways, but ultimately the beacon "host" still needs to create a "session" that other beacons can find
I see
There is a steam party plugin on marketplace, I think that has a pretty decent implementation using beacons
I will try and have a look. Thing is, I already had a plugin called SteamCore which I used for leaderboards and it has functionality for Steam Lobbies
I have been experimenting yesterday and it seems that they could work but as far as I know, after you join a hosted game (level) the lobby is destroyed, so it might be tricky and annoying at the end of that map or after leaving to recreate the party
Almost every Steam plugin on Marketplace has it's own ideas on how the interfacing with Steam should work tbh
And I read somewhere that using beacons you could retain the people who joined after a game session has ended?
I doubt any of them are really compatible with each other
Beacons are actors so their connections are ultimately destroyed between level transitions, but if you wanted to retain the members, you'd keep details of the party somewhere and attempt to reconnected afterwards
lobbies don't need to be destroyed when you join the game
making that action implicit is just bad
Can you be in two lobbies at once on Steam? i.e. a listen server and somebody elses "party" lobby?
steam lobby is completely independent of unreal ingame connection
and no for 2 lobbies
rgr. always wondered...
you can be on multiple party lobbies I think
well a lobby is just a lobby, I don't think there's any kind of differentiation on Steam
Same is true for Epic online services
Listen Servers in UE are done via Lobbies
didn't have time to dig into EOS
but coupling that with ingame sessions would be crazy
I guess it's just a lobby with a map loaded as listen
just limits your options
So yeah, the TL;DR is.. "it's complicated" ๐
It is indeed x)
and it doesn't help that to properly test lobbies, it needs multiple steam accounts, ie not possible with a single PC
except with some way of vm
@Shinzo - Ed#8762 to be simple OSS is UE4 term which provides c++ APIs for your game.
OSS is nothing but a frontend wrapper above your game backend service
tbh for multiplayer dev having more than one machine is essential
Even if it's just a crummy laptop you use to host a session
Yeah that's what i was doing to test Steam on a previous game
You might be able to use a VM for some stuff.. but there's no substitute for "really" testing on two different machines, and ideally on two different networks too
True yes
I am still hesitant on whether to go for Steam lobbies only or try to work with Beacons though
@gusty slate Engine already have production level party beacon actors
It should be inside OnlineSubsystemUtils module
Not sure though
But you really can use them for allsorts. We use them in HLL for a server queue
how much is the Steam OSS handling that though?
If you want one machine to connect to another, be it via beacon or the usual hard-travel route, you need to advertise a session of some kind
and AFAIK on Steam, you can be in one session at a time
I read some of your comments above Jambax and posts on forum from 2017 about beacons and Steam, how advanced or handled is it currently?
Because as beacons are based on lobbies (sessions are lobbies basically as wel) and lots of functionality is there, I might research and experiment before working solely with Steam lobbies
Beacons aren't based on anything, they're just actors with a net connection that doesn't need you to load a UWorld
The actual online implementation of them is entirely up to you
The Party beacons I meant sorry
I know there was already a client and host beacons supposed to be aimed at parties
The UPartyBeacon classes are designed to work with IOnlinePartyInterface - and currently there is no implementation of that for Steam
(And there probably won't ever be)
I see what you mean. There is initial abstract implementation of it but it isn't implemented with Steam's backend interface, API and how steam handles itself.
I might look into implementing it with lobbies then, because my current target right now is Steam alone
Because, I won't have the time to implement that on my own
might as well implement it on top of lobbies directly
That's basically what you need to do on Steam
Or you host some kind of other server outside of steam, like an XMPP server, and people connect to parties like through that
Hey Guys... I have a Animation blueprint which needs variables from the player character but whatever I do they won't apply for some reason
This is probably not the issue, but it's bad form to pin items across paths like this. It makes it difficult to follow, and may cause you problems if you're not careful with what you're pinning. You're better off calling a reference to the variables you need when you need to use them on separate paths.
it seems you are not updating value. you cant just take the value out of other execution chain.
this set blocks just sets value on begin play then returns the value you've just set. that mean on next frame you wont get data out of it if i correct
The Input X and Input Z values should not be set to replicated if they are being fed in by player input.
you need to use get for that
@sinful tree I don't really get what you're trying to tell me tbh because... it is the place where I need them to be... inside the animation blueprint so I can change the animation being played
Disconnect and get the variable instead of pinning across execution paths
still the same problem
That variable should not be marked as replicated.
was probably just me... trying to get it working well
what about the other variables ?
So this too is in the AnimBP?
That's in player controller
it makes the character move
pretty much the "third person example" logic with some validation and debug stuff
Why couldn't you just call those in the character instead of from the controller?
Because I may add functionality to swap characters ingame later on
That's fine, those characters can inherit from your main character if they use the same control scheme, otherwise they can have their own controls.
I'm not seeing anything else particularly suspect. Perhaps verify using print strings on the cast failure and valid checks just for debugging. There may be something not getting set somewhere correctly.
Already done that it's getting all variables on the server too but it just won't apply the animation
it stays with idle
on Both
Server to Client
Client to Server
The local character is working just fine
so the local character is moving but from other client - it doesnt?
it moves but it's not animated
is it not animated on both side ?
i thought about it) So basically you pressing the button on the client and information about it doesnt send to the server
it seems
@mortal kernel is the Character's class defaults set to replicate ?
It's the same if I move with the server btw... the client also doesn't see's it's animation aswell
ahhh im bad at explaining))
so movement component receive input and moves pawn on server BUT you sets the variable on the cient side so the server doesnt know about it
your debug shows input x on the cilent = 1 but on the server = 0
yea because the server is the player I don't move :o
is far as i remember debug shows value on server and same value on client
if you replicate it
Don't think it would show on server as the variables aren't being sent to the server. (I think)
The Input X and Input Z values should not be set to replicated. If they're being set by the client, the replication thing does nothing.
Out of curiosity, is your character inheriting from Character or Pawn?
I've created it from the ThirdPersonCharacter Example
so it should be a Character ?
Yep, that's good.
Are there any known issues with replicated Child Actors?
I have a replicated actor that has two Child Actor component ("hatches"), themselves also replicated.
When I use this setup in multiplayer, the "Child Actor" of these two components is... None.
is this a known behavior?
I am avoiding this by spawning on server on begin play, which works, but this is unexpected to me.
Can some kind soul please confirm?
@mortal kernel Mb i wasnt very useful here, but maybe the problem was that Player controller doesnt replicate to other clients. coz they dont
Well.. I can't get it to work
I asked this question earlier, but it has since gotten buried, and I have yet to figure out a solution. Let me know if anyone has any ideas
Creating online subsystem instance for: Steam
Warning: Steam Dedicated Server API failed to initialize.
STEAM: [AppId: 0] Game Server API initialized 0
Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
Display: STEAM: OnlineSubsystemSteam::Shutdown()
Warning: STEAM: Steam API failed to initialize!
Display: STEAM: OnlineSubsystemSteam::Shutdown()
Login request: ?Name=CubedMango userId: Steam:111111111111111111 platform: Steam
PreLogin failure: incompatible_unique_net_id
I receive the above errors when launching my dedicated server (on an EC2 instance). I've followed the documentation when setting up a dedicated server with Steam multiple times. Steam initializes for clients (clients can use the Steam overlay, for instance), but the dedicated server throws these errors and refuses clients that are running Steam
this is normally cause the appid text file is missing from the binary folder on the executable
can you verify if the text file is there?
should see something like this
In my packaged game with the server as build target, the file should be in Engine/Binaries or ProjectName/Binaries? I assume the latter, regardless, the file is missing from both
without that, it wont find the id
try creating the file and put your app id in it
just the appid
that's crazy XD
Should I put the file in /ProjectName/Binaries/Win64?
Hello. I'm in a huge bind that's been frying my brain and agitating me for 4 days straight. Any chance I could ask for some help?
I'm still getting the same error in the dedi server
I do notice that the error only occurs when the client tries to join
interesting, and you have the steam api stuff ?
there is additional stuff iirc (steam client files)
That doesn't get added automatically when packaging?
though i have not done dedicated server with steam, just from what i have heard
no
its not part of the SDK
its part of steam
That's strange. I haven't heard of that before
you have to download it yourself and even add code into the engine.ini file
ill link a video for the advanced sessions plug in for ue4 that helped me
Hey all,
today we are gonna work on the integration of the Advanced Steam Session Plugin
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassNam...
then the code would be creating and getting advanced sessions and can get ids from that stuff
I'll check it out. One other thing, is that I attempt to connect to the Steam server via the open ipaddress command, not sure if that matters
noo
actually
maybe
i am not sure how steam dedi's work
but yeah you probably need IP for steam dedi's
also the steam interface sometimes doesnt work if its just hitting play, u wanna stand alone game, or if that doesnt work launch the game itself from the folder ur making it in
im not sure what that means, but thats how i got it to work on mine
this returns the result that you connect to
while hes trying that is there a chance i could ask for some help?
@mortal kernel so the problem is that this variables wont replicate. you made this in player controller but they wont replicate. Every player has its own PC and server ,in this case is the host, has its own PC as well. Try to make RPC from PC to owning pawn with 1 flaot param(speed or sthm) and set it in the pawn with replication on. and then use pawn value in your BP_Anim.
To sum up it will be smth like this Client(PC owner (doesnot replicate)) -> To Owning Pawn on the server (which replicates) -> to BP_Anim. Hope this will work for you
why would you send the input every tick
to the server?
btw @fast arrow that will not work, Replicated variables have to be set on server to replicate, client will never replicate, and the inputs are always local.
thats what i've said. damn i need to learn how to explain stuff to ppl)))
this pic in not mine btw
it's his
ah lol
@meager spade I have tried setting it on server but it doesn't work
you were sending a RPC every tick btw
Right now i don't really care... because I wanna have it working first but welll I can't seem to do it
But it is not how it should be done)
btw yours will fail
and i really want you to understand why
do you understand what this is doing?
@lucid vault which documentation BTW?
trying to teach here
ok)
XD
Here
Why?
nope sry) got 10 min then have to go)
let me explain, this function is being run on the server
so what would the value of My Var be on the server?
@lucid vault just checking there are so many
I think I know why my stuff isn't working already but I'm not home anymore So I gotta wait
so why would it not work?
Maybe it's because my Movement logic (with its variables) is inside the player controller
Which doesn't really replicate at all
nope
its like i said, your server RPC is wrong
you are telling the server to sets it X and Y axis to the values it already has!
not the client values
What even means Rpc in the first place
please read this
and this is what you need to do. https://www.thegames.dev/snaps/UE4Editor-Win64-DebugGame_rGHwftw1Ge.png
why u giving her the run around, just tell her
hope you can understand.
@twin juniper cause people never learn by spoonfeeding
i can easily just give someone some code or a bp screenshot
but will they understand it? no.
Remote Procedure Calls
you teach them why as you show them how to do it. not ask them why it wont work when they already dont know why it wont work
thats why there here for answers
call from serve to client or all the way around
@mortal kernel btw, running that RPC on tick is not very performant
in sense of network traffic
thats 8 bytes being sent every frame (though some maybe dropped cause its unreliable)
Yea I know but I can't seem to figure out a proper way of calcuting my 8 way walking Animation :o
you can do that without needing a RPC of input values
If theres some way to get this... I'm in
you can calculate deltas between the last movement velocity
and work out if they are moving left right, backward, forwards, or diagonally
Blend spaces do this automatically
My main issue is... by using the vector length i always get the max movement speed... no matter if I'm walking left or right or backwards
So I tried getting this input variable to do it for me
Which leads to me being here right now 
Are you trying to determine the where your input points? like "right side of character" or "forward of character"? There are too many messages I couldnt catch up but if you are trying to do this I can send some examples
@peak sentinel
Basically I have an 8 direction blend space which needs speed and direction...
But the normal vector length is giving me the max speed all the time no matter what my character actually walks
Thus I used the input variable for this which didn't replicate which brings us where we are :o
I would like to show a blank screen in MP when the level boots up. I create a blank UMG on BeginPlay of the PC and add it to the viewport.
This works nicely on the listening server, but due to latency on the clients you can see the workd for a blip of a second. My understanding is that this is due to PC being created later on the clients, and the world may already be up (ths character often is, actually).
What is the best way to avoid this?
I would like to avoid the hack of setting exposure to -9999 on the map or so
There should be a "Calculate Direction" node in anim bps
You plug direction and velocity and it gives you direction with an output of float
You use it as Direction variable
And use velocity as speed
does it matter?
you can spawn widgets on the GameInstance btw
in c++ at least
create widget takes a PC
not sure in BP
@peak sentinel but velocity only gives me a postive value not a negative one... means I won't be able to walk backward
yep the node asks for a player owner
hey since this got buried before...
Are there any known issues with replicated Child Actors?
I have a replicated actor that has two Child Actor component ("hatches"), themselves also replicated.
When I use this setup in multiplayer, the "Child Actor" of these two components is... None.
Also... it starts at the back with -180 goes up to 0 which is front and then goes 180 back on the other side
I am just working with anim bps and blendscapes at basic level but I am pretty sure you cant (shouldnt actually) go for negative values
This means -179 is back and 179 is also back
given the assumption I am making a FPS game like COD Warzone.
is it better to statically place loot boxes and active them randomly when begin play called.
or make something like spawn point that spawn the real loot boxes ?
And its working on Listen-Server
Yeah, but you should add me friend first to access the DMs, its blocked
I guess if I place them statically, whenever clients reference them , their Full path must be resolved to NetGUID which is not good
@peak sentinel Apparently im not allowed to send you friends requests lol
You gotta add me first
Can anyone help me figure out how to properly close a server when a match finishes?
I'm using the AdvancedSessions plugin and can handle hosting, search and joining fine, but for some reason Destroy Session doesn't execute.
it needs to be executed by the server and players need to call it as well (When they leave)
You need to handle players logging off otherwise they don't properly exit the sessions and you'll have problems
I figured it would cause problems, can't host a new match if they just open level to the main menu again.
So what, would that be a custom event with multicast going straight into Destroy Session node?
i find it easier to just execute it from BeginPlay in MainMenuLevel
In the default networked character, how do they replicate movement from server to client? Is it just by tick? or is there a different way?
Hello everyone ๐ . I have an issue which I struggle with for 2 days. My character is set up, but something is wrong with head rotation replication. Could you help me? Client character is rotating the head in Server character eyes but Server character doesn't rotate it's head. Every variable used for this is set as replicated.
Can ChildActorComponents be used inside multiplayer, can they be replicated?
can Unreal handle 3 buttons at the same time?
i'm trying to make my characters walk when i aim+fire+move
What would cause unexpected breakpoints when building a dedicated server for a blueprint project? The breakpoints never appear in Visual Studio, unless it is built as a "development server"?
Here is the error log I get in Visual Studio
Does a client know the class of the current gamemode? Say if I need the gamemode to have its own pause menu widget?
it says what the issue is
@unkempt tiger client cant access gamemod
gamemode, so no
Alright, thanks ๐
Yeah, though I'm talking about a per-client pause menu
I think what I'll do is place it on the gamestate? Hmm
Actually not even a pause menu, just a basic score screen
a score screen is just local
what does that have to do with gamestate or gamemode?
when play presses say tab, you create a widget, that pulls in the scores from GameState (and possibly all player states)
I've redone the Steam dedicated server setup so many times at this point, but I can never get it to work
try to lunch it on other machine)
Does anyone here use playfab?
or try to lunch your game via command line with -NOSTEAM
so the CMC prediction works basically like this?
- client generates a "move" that has input information and some kind of ID
- client performs the move, saving the last authoritative state and a list of all moves performed since
- client sends the move to the server
- server checks the move is valid, edits it (?) if necessary
- server performs the move
- server replicates its new state, including the ID of the last move it got from the client
- client updates its authoritative state, discards all moves up to and including the ID of the last replicated move
- client performs all remaining moves again, on top of its new authoritative state
i know there's probably a lot more going on under the hood, but im trying to copy the basics over to another non-movement system and support server correction, resimulation, and rollback.
The only thing I'd add is - server needs something more subtle than "performs the move"
Client and server have different framerates so the server needs to merge or cut client moves
A client's 60fps incoming moves would be played two by two on a 30fps server
okay, so server performs any moves it received in the last frame by merging them, or performs the last move received again if no new move was received this frame?
When I implemented a custom movement component, I was sending the client deltatime as part of the move
Server would play as much of the move as its own deltatime, keep the rest of the packet if it's too large, move to the next one if too little
I also added a variable speed modifier that would allow a 10% speedup or slowdown to compensate network changes
was your custom movement component basically a full replacement for the CMC?
Yeah, except way simpler, it was a flying movement
any resources on doing something like that? i hate the CMC but I don't have a lot of knowledge on where to start with coding movement from scratch
Not really, this was a trial and error thing over a few months
You have the thing clearly understood
Implement slowly with a lot of logging, some debugging tools - I had a tool to plot client(s) and server transform over time to compare discrepancies and understand when rollbacks had to happen (resetting to server state brutally, on owning client)
I want to eventually learn how to make a multiplayer so that I may play games I make with my friends. Is it easy to rent a cheap server for like 20 dollars per month and connect us all to that? Or is that not really a thing, and we will be forced to still try to connect to a host players IP address? Iโm completely new to this and clueless sorry lmao
My advice is to avoid servers entirely
UE4 has a listen server setup where one player hosts
Use that + Steam matchmaking and you'll be inviting your friend to your session once both of you have started the game
(using the default Steam ID, no fee or Steam setup required)
Howdy, I'm attempting to debug a server crash of my dedicated server binary...it seems to only fail in my PlayFab server container (restricted windows env), I looks like maybe a DLL error but not sure...I can see all the DLLs referenced in my package that is being deployed, and ListDlls says they should all be accessible I believe...OTOH, I'm wondering if the mistake is more basic...We're using FMOD for sound events, and I wonder, do I need to guard triggering sound events to be remote only w/ a has authority switch in a dedicated server env?
I've tested this just running locally and everything runs fine client/server standalone...its when I move it to the hermetic env that it seems to fail which is weird.
Per FMOD, it sounds (haha) like they already disable FMOD from actually outputting sound on dedicated servers: https://qa.fmod.com/t/disabling-fmod-on-dedicated-server/16017/2
that was my expectation as well!
Your best bet is probably to make a clean VM or something on a local computer and see if you can repro the issue.
playfab does have some local debugging tools you could use but I doubt an fmod crash has anything to do with the playfab stack - just running the server manually on a clean windows vm is probably enough.
yeah it could be the difference between regular windows and server core
which is what playfab requires
@fast arrow What does -NOSTEAM do? It got the warning to go away by using it, however, when a client connects with the open ipaddress, I get a PreLogin failure: incompatible_unique_net_id error.
Does Steam even work when launching with -NOSTEAM? Or perhaps I should not be using the open command
1 vote and 3 comments so far on Reddit
What I don't understand is that I was never running both on the server, only the server exe
It says IpNetDriver listening on port 7777. If I'm not mistaken, it should be SteamNetDriver instead. It seems like -NOSTEAM prevents the dedi from even trying to use Steam
i think the cli argument -force_steamclient_link will work
lemme double check that that is the actual argument
the issue is not with UE4
it's with steam
you cannot link to the steam server dlls while a client is running
so you have to force the link to the steamclient stuff
yeah
-force_steamclient_link
run that in your command line
@lucid vault
the code for it is SteamSharedModule.cpp line 192
if you are running a dedicated server, it'll use the steamclient link rather than the steam dedicated server link
you'll still ahve issues because you are putting two apps in the same steam space, but it should let you connect
If you are having issues running a steam dedicated server and a client on the same machine, try launching the server with the -force_steamclient_link command line parameter
@gleaming vector My issue is that I'm not running a client. I'm only running the Server exe on a remote machine
Does UE4 not bundle the right version of steamworks when packaging?
it's a few versions out of date i think
1.48 iirc. I updated to 1.49, but 1.50 is most recent
it's pretty trivial to update it
My packaged game only has 1 steam dll. steam_api64.dll. I assume that's what needs updating
also, in steam, you have to enable the steam binaries
for dedicated servers
and it dumps them into the root folder, i copy them into same folder as the exe (Game/Binaries/WIn64)
I have a task in my backlog for my game to fix this
but, i do it every time i create a new dedi
Where do you enable the steam binaries? Do you have a resource for that?
it's in the steamworks config
in the steam backend
where you select the dependencies for your app
yeah
in your dedicated server's app config
Steamworks Settings -> Installation -> Redistributables
your app has to be a linked Dedicated Server tool app to your main appid
Ok, I think my confusion is coming from the fact that I am just testing with the spacewar id 480. I have yet to set up my own app with Steams backend
Did you receive the same Steam error, about Steam failing to initialize?
i did, but i never used 480
the two things I had to do to fix it were update steamworks, and put those binaries in the executable directory
Yeah, my steamsworks folder shows v147, which is 1.47 i assume
yeah
it's really trivial to update steamworks if you are using a source build of the engine
I guess I can just download the latest from online and drop it in there
Yeah, I do have a source build
just copy the updated steamworks into a v150 or whatever the version you use is
and then change the steamworks.build.cs to use that version number on the first line of the module build class
it's super easy
I made the version change in the Steamworks class to 1.50, but I'm still confused as to what i do with the downloaded 1.50 sdk files. Do I replace them in the packaged project, or somewhere in the source build?
Of course, the packaged project only contains a single steam dll, so I assume I need to make the file replacements somewhere in the source build
Ah ok, I found the location
Yeah, I just added that folder and files
in the engine
yeah
i did this like 6-7 months ago
so im going off of memory
and updating steamworks is kind of the thing you only do once lol
how do we make a coop game?
that is a big question, and probably none that can be answered for you easily
I often say those are the wrong types of questions. How do you make a coop game? by making one
i recommend looking at some samples
and tutorials
I don't have access to the Steam back end as I have yet to setup my own app there, I assume that's necessary for the steam binaries step
it is
unfortunately it's $100 to get a steam app id for the first time
which is kind of annoying
@gleaming vector i mean a drop in drop out co op
Yeah, I don't mind paying the fee
where the other player can go and load another area
and not drag the host with them
there are some GDC videos on how Bungie did it for Destiny
destiny was butchered
you'll struggle with it in UE4 though, since it doesn't do peer to peer
oh?
I thought UE4 does have multiplayer
Gears of war and all
Gears of war 3 had P2P
on UE3
Hmm, I wonder if I will be able to access the binaries before the 30 day waiting period
Definitely watch the GDC videos on what bungie did because they're interesting, but definitely don't try to copy them for a real game unless you're a AAA because their hybrid p2p/dedicated bubble system is insanely complex.
dont bother answering him, i banned him for being racist in other channels
Oh, rip.
Yeah, the process looks slow for Steamworks. I'm stuck on the tax info section until my identity verifies (2-7 days). I guess I will try and launch my server with the updated steamworks sdk and see what happens
Still working through this: https://qa.fmod.com/t/ue4-25-dedicated-server-binary-crashing-after-integrating-basic-fmod-events/16572
Howdy, Iโm attempting to debug a server crash of my dedicated server binaryโฆit seems to only fail in my PlayFab server container (restricted windows env), I looks like maybe a DLL error but not sureโฆI can see all the DLLs referenced in my package that is being deployed, and ListDlls says they should all be accessible I believeโฆOTOH, Iโm wonderin...
I managed to detect that the DLLs are not being loaded, even though they are present after packaging :/
not sure what to do about that.
they are in my $PROJECT/Plugins/FMODStudio/Binaries/Win64 folder...do they need to be copied elsewhere perhaps?
maybe they need to be in $PROJECT/Binaries/Win64?
but its weird they are attempting to load ../../../ ?
starting to wonder if its Msacm32.dll is missing from Windows Server Core
So I created a steam connection. I invited my other account through my game invite. The account accepts the invitation. We are both in the same game. When the other party choose join game , he doesnt see the server.
as in doesn't detect the server on the list of available games to join?
check how many players you're allowing per game if so
Allowing 2 and still using the default steam id spacewr if that;s not an issue
if you're allowing 2
your game is full
and is filtered out of available game list
3rd player wouldn't see it
So to create a party of 2 i have to allow 3
no to have 3 you need to allow 3
This may be a silly question, but, how do I build the binaries for the new Steamworks SDK that I pointed my Steamworks.build.cs to? I built with both Development Editor and Development Server, but the \Engine\Binaries\ThirdParty\Steamworks\Steamv15\ folder was never created
An overview of Online Subsystem Steam, including how to set up your project for distribution on Valve's Steam platform.
@rapid bronze I appears that the compiling UE4 section is outdated. OnlineSubsystemSteamPrivatePCH.h does not exist. Rather, OnlineSubsystemSteamPrivate.h. However, it does not contain #define STEAM_SDK_ROOT_PATH TEXT("Binaries/ThirdParty/Steamworks")
I think the step is not longer needed
If you're building on 4.25 and have the newest version of the SDK if it's giving errors be sure to get into SteamSocket.cpp and replace ReceiveMessagesOnListenSocket with ReceiveMessagesOnConnection.
@rapid bronze I already did that an solved all of the errors. However, after both my Editor and Server builds completed successfully, the binaries for the Steamv15 were still not created
Is the editor development build supposed to build those binaries?
You mean Binaries in the sdk folder?
\Engine\Binaries\ThirdParty\Steamworks
The binaries in that folder
There is supposed to be a Steamv15
Oh no no
I have the Steamv15 folder in \Engine\Source\ThirdParty\Steamworks\Steamv15. But, when I package my game in UE4, I get an error because the binary version is missing
You literally need to copy them from your Steam to the Engine
The compiled Binaries
You actually need to put them in yourself, i think half are included in the skd, half from actual Steam folder
I will attempt to do that. Am I not supposed to have the SDK in \Engine\Source\ThirdParty\Steamworks\Steamv15 as well?
Yep yep
I notice that the previous versions, such as 1.47, only contain the steam_api64.dll and none of the others
Are the other files no longer needed perhaps?
i think depends on the platforms you want to built it on too
but in theory i think they just go for win64 and linux64 in the sdk that's already there
i kept everything just in case
Question is, are the files from my Steam directory the latest (ie compatible with the 1.5 SDK) ?
quick replication question
i set my player up for on begin play it creates a widget hud and adds to viewport, as you may know when the clients join they also make one and add a second and third hud to the servers hud. so clients have one but server has 3. how can i make a hud widget just for clients and not make another one on top of servers
@everyone idk if that makes sense
Branch on "is locally controlled" before spawning widget.
thank you , fixed
is there any plugin available that actually helps replicating physics?
or rather, how would you go about it
just running into a ball or a cube for example causes a bunch of issues
I have a gamemode bp that I am trying to take a variable from and update it in a HUD. How would I do this for multiple players? I keep getting a null reference to the game mode for player 2
@vocal cargo Not really. The non deterministic nature of UE4 makes it super difficult. A solution that i have done before is to locally simulate physics for the nearest player, but that won't work if multiple players are interacting with something at once
@twin juniper use the GameState. GameMode isn't replicated
I wouldn't count on it. Although, apparently Chaos improves physics across the network. Haven't used it yet
huh, interesting
what about things like physics constraints?
I have a character attached to a physics constraint so he can 'swing'
this work pretty damn well in the editor
simulate ping and test again
but when I run that on a dedicated server..
net pktlag=150
I tried that too
seems 'alright'
but when I run it on a dedicated server it blows up
but in your opinion - would something like this work?
If I multicast the attachment to the physics constraint technically it should work?
So for my NPC Actors they have the ActorOnClicked event setup, but when they are clicked I need to get the Player that clicked it so I can RPC to the Server to update their Target. I was using Get Player Character with the index of 0, but that just gets the first player...
Would the ue4 character movement component need any changes if it were to be used in a competitive fps? I would assume games like fortnite and valorant customize it right? (specifically talking about the networking portion of the movement component)
Hey, do you guys know why is pawn movement so jittery?
I will send a video wait a sec
@final rover change what exactly?
100 FOV
yeah i can tell ๐
you sure that jitter isn't animation jitter?
ie wrong values in your animgraph?
no because in first person everything is okay
does it happen in standalone (just server)
is your skeletal mesh replicated on the character?
yes, I'm controlling client window now and in server's eyes everything is okay
you mean this one?
okay, so what could be an issue?
Yop
because in everything is okay with client pawn
Can totally be that it's because you are using code that is more precise on the Autonomous end
Does that only happen if you walk backwards?
from what I can see, nope
this is in animbp?
why are you using replicated properties
in the animbp
you do know that it does not replicate?
yes, but needed to try earlier for something else
nevermind, something for head rotation
well make them all non replicated
cause the should not be replicated
i need to see more of the graph
that's the rest
why are you adding local rotation?
in the animbp?
why are you using GetPlayerCharacter 0?
do you understand what GetPlayerCharacter 0 is going to do?
honestly, that static is 90 percent of the causes of breaking in multiplayer games
what will GetPlayerCharacter 0 do on the server?
okay, pinned it it to Try To Get Pawn Owner
who will that return?
also don't ever manip the pawns rotation in the animbp
okay so what do I do instead?
do it in the pawn if needed
what is that for anyway?
why are you doing that?
some hacky turn in place system?
yes, for turn in place
its wrong
you should never rotate like that
TIP is smoke and mirrors
what you do is, calculate the delta rotation, and counter rotate the root bone
okay, I unpinned this part of code
it's not glitching anymore, but the head is behaving weirdly
when threshold is reached (like say 90 degrees), you interp the root bone
what you mean the head is behaving weirdly?
I wouldn't care about turn in place that much, but I want player to behave like that.
right?
so if you go left/right head stays in place
you need a proper TIP system
give me a sec
ill make a BP version of C++ TIP system
alright, thanks for helping me
#animation ill go over it there
Hi, I'm using OSS.VoiceLoopback 1 to get the voice back, it seems to be slightly jittery and the threshold seems to be very high, I also set this to Set Mic Threshold -1 My father, who works for Nokia currently working on a VoIP system, mentioned that it could possibly be due to the fact too much is going over the port. Is there a way to change voice to a different port? if I understood him correctly..
My problem is the voice is only detected when the mic is literally on my mouth, and the voice coming back is jittery, anyone know which could be the problem ?
WOW
I think I solved my Steam dedi server issue
I had to install the steam client on the dedi for it to work
I believe this is necessary when using 480 (spacewar)
hey, LaunchCharacter won't work at all in multiplayer even with these flags on
what's going on?
I don't know about messing with those two settings, but LaunchCharacter works fine if you just call it on the server as far as I remember.
When i move my client i get major rubberbanding. Im guessing that movement BP is made incorrectly, but how do i correct it?
Why do u need launch char
If it's for dodging then u can just build a custom cmc
how do i call it on server?
i'm making the lil smash bros launching mechanic in 3d
From input, you just need to ServerRPC.
in my multiplayer game, there are NPC Characters that fire the ActorOnClicked event when clicked. this all works fine in a standalone client or when running as a listen server client, but when you are a true client connected to a server and click on the Actor, my SetTargetOnServer RPC fails to call because LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor NPCCharacter_2. Function SetTargetOnServer will not be processed.
Watching the debug on the blueprint, i see that its NPCCharacter (Client) that fires the event, which looks correct I think. But, I see the Self is actually NULL.
This is the basic event handle on the BP. The event fires but Self is always null so it can never call the server function.
I think if I understand correctly, I need to reroute this somehow through a Player Controller pawn, but how should that work? I normally cannot get the actual Player Character in this instance since its a Client and an NPC but I did come up with a fairly crazy method that accesses a Global client only object to get the Client instances real player character.
@vivid nymph You cannot RPC to server from an actor that the client doesn't own.
So yeah, generally you'd probably use something like an interface. On click, get local player controller, call server RPC, pass clicked actor through and then call an interface function on the Actor pointer.
It feels dirty, but it seems maybe I can store the clicked NPC reference in a kind of QueuedVariable on the Player, and then on Tick check for a value and send it from the loop
is it valid to call a client rpc from a client? shooter game seems to call ClientSendRoundEndEvent from clients when they exit to main menu:
void UShooterGameInstance::EndPlayingState()
{
[...]
if (GameState)
{
// Send round end events for local players
for (int i = 0; i < LocalPlayers.Num(); ++i)
{
AShooterPlayerController* ShooterPC = Cast<AShooterPlayerController>(LocalPlayers[i]->PlayerController);
if (ShooterPC)
{
// Assuming you can't win if you quit early
ShooterPC->ClientSendRoundEndEvent(false, GameState->ElapsedTime);
}
}```
@fringe dove Sure, It's not any different than calling a ServerRPC from a listenserver.
yeah, it won't use networking at all
thanks
is there a built in cleaner way to log out a client? stepping through it seems shooter game just relies on the main menu map load to shut down current net driver
more specifically I'd like to make sure any previously reliably sent RPCs from client are acknowledged before exiting (with a timeout if it takes too long)
or maybe the net driver shutdown call already does that
I can make my own ServerExitRequest RPC or something and do it manually, just didn't know if the gameplay framework already had something similar
one related thing I see in the code:
I guess that is for removing a splitscreen player usually
If the server spawns a brand new actor, and immediately after sends a client some reliable RPC with said actor's ptr as a parameter, is there any chance that for the client that actor would still be null?
@unkempt tiger I think it could be, which may be why pawn possess has a complicated acknowledgement flow
hmm I see, yeah it is indeed null for me, just checked
So I moved the RPC call into my Player BP, and I am still getting LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor ThirdPersonCharacter_C_1. Function SetTargetOnServer will not be processed.
@vivid nymph doesn't matter where the call is called, I think the actor channel it goes on is determined by on which actor it is defined
not sure I follow, so what I did was store the clicked actor on a global variable available on the client, and inside my Player Character's BP OnTick, I check if that variable is set and then do the RPC call
@vivid nymph is the player character possessed?
it should fail I think until it is possessed and starts going I think through the player controller's connection as a result
hmm, i mean i can walk around with it np in that window
did you only spawn it locally?
its definitely replicated, I can see it moving around on the other clients and vice versa
I'm not sure then, it should have a working connection if it is able to do that
Anyone have tips on finding fonts with licences that allow their use in marketplace assets?
wrong channel I think
did much change with NP plugin from 4.25 to 4.26?
there are a couple youtube videos from the guy working on it but that's about all I've seen
NP is supposed to be CMC replacement, if you somehow managed to use NP , then you GAS will break
This video I have seen.
can do more than CMC replacement with physics, vehicles, etc.
I have been patiently waiting for gas support from very long
I think their integration would be having GAS stuff that affects movement be integrated into the network prediction system rollbacks and stuff
they have stuff with their NP ability test scenes but it is their own ad-hoc ability system I think
i didn't ask what they would have, i asked what you would want
like how would it be integrated into GAS?
cause they are making a new CMC based on it
which would handle movements, but this would also be external to GAS anyway
Dave Ratti in one of those videos said they would like to integrate it, I assume making one or the other a dependency or putting in some kind of api for optionally doing it
they wouldn't make it rely on GAS
so GAS making it a dependency sure
but not the other way round
Stupid ask but : What happen when you call a "Server, Reliable" function on the server ?
- This is treated as a simple function call ?
- is it a good practice to do this on every server function, to avoid calling them by mistake on the client ?
its not a good practice really no
and yes it is treated as a simple function call
though you should strive to keep the logic known
why would a server call a server rpc?
why would a client call a client rpc?
seperate them.
make a function
that is not a server rpc
then handle that internally
in BP though, you cant really hide stuff away
in C++, we only expose stuff to BP that should be called
well that would say this function should only be called on server
it doesnt force it tho
its more a cosmetic thing
client can still call it
It's enough.
i mean beyond function commentary + visual logo, my job is done here.
(yeah, that retarded, but designer MUST have the possibility to call this function)
cause it's use in quests.
Also, i don't remember but... we agree than OnRepNotify aren't called on server in cpp, right ?
yup, thanks
Almost at my wits end trying to figure out why my ThirdPersonCharacter, which is now spawned and possessed by the player after OnPostLogin still cannot call an RPC to run on the server. The error is still "No owning connection for actor ThirdPersonCharacter_C_1. Function SetTargetOnServer will not be processed."
because there are 2 of them
one owner one not
and both are sending the RPC
and 1 errors out
most likely
Nah, i verified it is only a single client instance that is trying to fire it, as it should be
when?
watching the flow in BP, checked all instances in the Debug Filter
hold on, i noticed something that isn't right
both clients are giving the same error with the same "ThirdPersonCharacter_C_1" which should different per client
not certain how that is possible, given that the flag to send the RPC only exists on a single client
that variable is not replicated
Is it good practice to tie user inputs like "Fire" into the movement component, and replicate them as compressed flags?
yep
@minor nova definitely not
what I am doing is, when an NPC is clicked, they have a non-replicated bool on them called IWasClicked, on the client inside the ThirdPersonCharacter BP I get All Actors with the NPC class and check for that bool to be true
how would you do about debugging a problem with fire then?
so that bool should only be true on the client that clicked the npc?
Hm, the same way I image you'd debug a problem with any of the character movement
you gain nothing by doing that
you make your code more convoluted
you break encapsulation
i mean what would the purpose be?
you create tight coupling with the CMC
as if epic doesn't have you already covered there
Well, I ask because this is how "fire" inputs were done in previous versions of the unreal engine if i remember correctly
they passed the bFired flag to server in ServerMove functions
really?
yep
I was wondering why there's nothing like that in current classes
I'd have to go back and check but I thought that was what I had seen in the past
i defer shooting via the CMC
{
Super::PlayerTick(DeltaTime);
// if we have no UKaosMovementComp_Character, we need to apply firing here since it won't happen from the component
if (GetPawn() == nullptr || Cast<UKaosCharacterMovementComponent>(GetPawn()->GetMovementComponent()) == nullptr)
{
ApplyDeferredFireInputs();
}
}``` ```void UKaosCharacterMovementComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
if (CharacterOwner)
{
AKaosPlayerController* PC = CharacterOwner->GetController<AKaosPlayerController>();
if (PC && PC->PlayerInput)
{
PC->ApplyDeferredFireInputs();
}
}
}``` but that is it
๐คท
no K is super weird @meager spade
How vulnerable is direct IP connect instead of using Steam address?
Is this following how they did it in the UE4 UT project?
yeah basically
i was looking at that briefly
but i would not send fire as a compressed flag
then again i use Gameplay Abilities for weapon firing
Legit having scope issues inside this thing. It loses the value of Self after the For Each Completed, I tried storing it in TempSelf variable, but it still doesn't like it...
eww why you using getallchars of class
why not cache your NPC's into an array when spawned
so much cheaper ๐
that is pretty bad
controller should have a good idea whats under its mouse at all times
so when you click it just sends that to server
what do you mean? controller knows whats under the mouse?
with the games where you click on stuff
controller should trace under the mouse on tick
i am changing away from that OnClick event from Actor, and doing it with a line trace
highlight whatever is under mouse via stencils or whatnot
and have a pointer to whatever is under the mouse in it at all times
Quick question here, somewhat new to network programming in UE4...
I want to make "switching weapons" smooth for the client. I intended to update a local replicated variable (on the client switching weapons), then make a reliable RPC to the server to tell it what i am doing. However, the docs warn against this because:
WARNING: Changing a replicated variable's value on the client is not recommended. The value will continue to differ from the server's value...
Is this a case where i can ignore the warning because the RPC is reliable so it will be eventually consistent? Is a there a better way to do this?
i dont use replicated props
for switching weapons
all my weapon switches are client side
even if server wants to change a clients weapon, it calls a client rpc to switch the weapon (so all weapon swaps are client side)
issue is you need to do checks
server can reject the weapon swap
then you need to handle forcing the client back to the other weapon
all my weapon switches are client side
But the client would have to update the server at some point to tell other clients that they are now holding that weapon, no?
Does anyone know if the Ping Variable in the player state is accurate?
cause when I use it
it doesnt seem to be
as I am USEast and my friend is USWest and he somehow has only 20 ping
@spare mortar yes via a server rpc
but you still need to handle roll backs
also pending weapon swaps (incase weapon is still in firing state)
there is a better version of ping @eternal canyon
you BP or C++?
ah
so GetPing does return ping
which is set
so..
i am really not sure how accurate that is
Ping is a replicated prop
its accurate enough for displaying ping for players on the UI
i would not run any gameplay logic off of it
Make sure you multiply ping by 4.
From the source code...
/** Replicated compressed ping for this player (holds ping in msec divided by 4) */
UE_DEPRECATED(4.25, "This member will be made private. Use GetPing or SetPing instead.")
UPROPERTY(Replicated, BlueprintReadOnly, Category=PlayerState)
uint8 Ping;