#multiplayer
1 messages Β· Page 567 of 1
You need two machines with two Steam accounts
Which is why you should develop sessions using the NULL OSS
And then test Steam when that's working fine
So your issue is just the Steam account thing
i dont think people view helping someone sort out a problem a waste of time
hi guys, I have an issue: I have a multiplayer plugin that sync correctly when I run with Play on Selected Viewport but it does not sync when I export the game or run as Standalone. Do you have any idea? Am I missing something? The session is created, client is joined I can see both users but this component is not syncing
What's up guys, how's it going? How can I make a multiplayer map rotation system?
@bitter oriole now ip connect also works, I setted up the project for both options
Of course IP connect means you aren't using sessions
Yeah sure, before I package the game and send it to my friend, I should replace null with steam right?
Sure
Noice
Hello everyone. This might be a bit general to ask, but i am not native with unreal so i am piecing together the informations i can find:
Unreal can run as an authorian server in a headless mode only displaying a log, or a couple of logs ? π
Question, suppose I have a class hierarchy of AK47 :: AutomaticRifle :: Firearm :: Weapon, and suppose to each of them corresponds a weapon state (containing the data necessary to make the weapon function), also with the hierarchy: AK47State :: AutomaticRifleState :: FirarmState :: WeaponState.
(For example AK47State holds IsSafetyPinToggled, AutomaticRifleState holds IsOnAutoFireMode, FirearmState holds AmmoCount, and WeaponState holds IsEquipped)
What is the recommended method of, given an AK47 instance, net serializing its state, so that it also automatically contains and serializes all the data of its parent states, so that I only have to write the net serializing of each state's data members once (for each state struct), and so that I only have to write the WeaponState net serialization once?
@bitter oriole ive managed to get two packaged games to play in a multiplayer listen server, but when I sent a build to my frined he could join π¦
any articles or something about the upcoming network prediction plugin? trying to read up on it
nvm guess the most relevant information is on the github https://github.com/EpicGames/UnrealEngine/tree/master/Engine/Plugins/Runtime/NetworkPrediction
Hi Folks, I have a question, in GameMode on PostLogin Event => Player Controller Object Reference => Player State gives a different PlayerID every time I load a different map, how can I get consistent unique PlayerID?
@vivid prawn Might depend which online subsystem you're using?
@low helm for local game
as in multiple people play the same game in one machine
I try doing the same game method, but that's for the local machine, i want to specify a separate user with separate settings and scores, but when I change the map all the user's playerID are different.
Has anyone ever noticed before that OnComponentEndOverlap() event get called earlier on the server?
@low helm save the information you want on the GameInstance
make a GameInstance child class and change it in the game mode
GameInstance persists from the moment you start the program till you kill it
If I am connected to a dedicated server using a Game Session, can I open/create a party session while connected? And then move my whole party to a different server?
guys, how it works the steam subsystem? so when I create the session the host is the player, right? And does he need to open the ports when creates the server? Steam subsystem saves the ip,port of the host in their servers?
Sessions and actual multiplayer are not closely linked
Usually, you do create a session for the host player, have the client discover that session by searching through friends or a list of games
And then the client joins that session
No ports required on Steam
I see, thx
does Online Epic Games services works on steam too? including friends for example? In case I would like to publish the game in both platforms
EOS competes with Steam
Not familiar with how EOS accounts can link a Steam account
Though I'd suggest releasing on Steam first and see later if Epic wants to buy your game
oki, is not easy to publish indie games on Epic I suppose
thanks @bitter oriole π how do you know so much about networking? do you know good resources for learning?
It's "get Epic to sign an exclusivity deal with you" easy
Expect 10x the workload of an offline game tbh
And I don't know that much, but basically learn the main tools : replication, RPCs, sessions ; and expect a lot of work to get it working, especially if you're trying things like physics or vehicles
@strong vapor yeah, but the moment changing map, the controller will have different PlayerID in its Player Status right, so how can I know the information belong to which controller?
Use the players' FUniqueNetID to identify them
You can grab that from their PlayerState, or from the OSS
@chrome bay Awesome, that's what I'm looking for. thanks alot π
Hey guys and girls π
Can anyone help me to clear up some questions that came up? Im just getting into UE4 for its multiplayer options so i might be a bit of a noob.
I cant wrap my head around how the dedicated server works, i heard its an authorian server ... but how does it know what functions to handle on his end and what functions the client can control, or does the server do everything, even opening up UI elements ?
@glacial burrow This is a good document to start from http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
I would ignore dedicated servers for now, the principles are not much different to a player-hosted (listen) servers
Best thing to do is study the content samples from Epic (ShooterGame if you're comfortable in C++), and/or just experiment with a simple project.
+1 for the compendium. Epics official MP tutorials are not great last I heard, but the content samples cover it.
Hi,
What is the reason for not being able to make a blueprint child of a C++ Actor component?
i heard something about replicated array of PlayerControllers in the GameMode in one of those Epic official MP tutorials @chrome bay
@chrome bay Thank you π
(Though I thought that was the default)
it is weird, i was unable to subclass UBoxComponent from BP, for one
at least around 4.15
had to make a c++ base just to add Blueprintable
da fuq :/
Oh hmm.. interestingly UActorComponent isn't marked as blueprintable either.. but you can definitely make BP classes of actor components
They must be doing something gross somewhere...
Ahhhh yeah maybe it's that
i think
i find it simpler to create my classes from the editor
and all ActorComponents add that by default
yeah
@vivid prawn thanks, i will take a look
@chrome bay Sorry for asking again, where should I add it in this?
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
UCLASS(Blueprintable, etc...)
I'm having issues generating the server executable for the dedicated server, plz help
https://discordapp.com/channels/187217643009212416/221799439008923648/752832840923742350
@chrome bay Thanks π
Which One is better third party for multiplayer handling in ue4? Photon?? or other?? Like shooting game realtime....
None
Pretty much zero reason to use a third-party networking solution in UE4 unless you want to make life hard for yourself
And it's unnecessary, you can bank on the vast majority of UE games using UE's own networking.
The only reason would be if your game has to connect to a non-UE4 game server. If you're doing a MMO with an UE4 client and a completely independent game engine on the server.
But then the network solution is the least of your concerns
@bitter oriole im now buuilding the dedicated server and everything seems to be working fine, shows up in steam servers list so ok
why I can't to connect to my UE4 server in my own pc by my public IP ? shouldn't it be possible ?
π€
depends. What OSS are you using
Should work fine then if you're using the null subsystem
I hear some routers etc. can be funny about that sort of thing though.
probably easier to just use localhost instead
unfortunately I cant use localhost cause the matchmaker gives that IP to all the player. (i am using my own PC as dedicated server + client and other developers connect to me)
π€
I think it was working fine till yesterday
π€
Can someone tell me exactly what's happening when there's an input on a client?
Is it
a) client input -> call RPC (client to server) -> server moves actor -> server replicates to all clients including owning client
b) client input -> call RPC (client to server) -> owning client has moved on its own accord -> server replicates to all other clients excluding owning client as it has already moved)
I believe a) is server authoritative and b) is client authoritative.
Is a) the default? And is this correct?
client moves the character locally and send the movement input and some extra data to server .
server verify and adjust the movement and send ack to the owning client to say hay your last move verified.
movement is replicated to other clients (simulated proxies ) normally by AActor.ReplicatedMovement and they simulate the movement.
its too complicated btw its just theory
@rose egret are you 100% sure that owning client moves the character locally without waiting for server replication?
yes. that's the important part. otherwise you could see lag
Wait wait wait. This is specifically for character right?
This only applies to characters
like, ACharacter?
yes
Yes exactly @chrome bay
For anything else, you'd have to do the networking yourself
don't tell me about ACharacter, I know it has client side prediction
And therein lies the rub
Is there no method to have an actor replicate locally first, and then RPC over to server? (and thereby serve replicating to all other clients)
nope
You have to do that
Client-Side prediction is only implemented for Characters in UE4
Anything else, you have to do yourself
I'm saying, I don't want client side prediction for my actor. I want client-authoritative
why I can't to connect to my UE4 server in my own pc by my public IP ? shouldn't it be possible ?
@rose egret because you cannot connect to your public ip, from your public ip
your router doesn't know what to do.
lol
In which case, you need to RPC the actors transform to the Server, and have the local player ignore changes to Replicated movement
@near bison what do you want to make ? ACharacter is enough for manythings . you can use its Fly, Swim movement mode for drone and things like that
@chrome bay why is it so convoluted?
Because I know for a fact that Fortnite is using client authoritative for their vehicles
If I packaged the game and server and both works as intented with sessions, and I can see the server in steam server browser. The chances of my friend being able to join are high?
@rose egret i want to make a vehicle that's replicated
That's how Fortnite does vehicles
Send input and transform to server
server runs physics in between updates based on the received input
That's great! @chrome bay. Precisely what I'm looking for. Does Epic have any resources for how they did it?
No, but it's pretty easy
server runs physics in between updates based on the received input
@chrome bay Could you elaborate more on this?
- Send Player Input and Physics State to server after physics has run. Do it unreliably.
- Server uses the last-received client input to continue it's own local simulation, but adopts the client state when it gets it.
Ignoring Server-Side updates for replicated movement on the local vehicle is easy, assuming the player has "possesed" the vehicle
All you need to do is uncheck "bReplicatePhysicsToAutonomousProxy" on the skeletal mesh
Key thing to remember is that the server won't get a steady stream of packets from the client, which is why you send input to it, so that it can try to fill in the gaps.
I also take it a step further and replicate the input to clients as well, so that they can do the same, and also because I need it to drive FX and sounds.
Replicate owning client's inputs to all other clients?
Key thing to remember is that the server won't get a steady stream of packets from the client, which is why you send input to it, so that it can try to fill in the gaps.
@chrome bay What's the mechanism for filling in these gaps? How exactly do you know you have to fill in the gap if you don't know when and where a packet has dropped?
Yes to Q1
And well it's simple really, the server is still running the physics simulation even if it's not receiving packets
So you just make sure that it's using the last-received input from the client to simulate with.
It's essentially free extrapolation
The engines built-in physics replication will do it's best to smooth updates on the clients
That's the million dollar question
They're doing input/physics state sanitization?
They won't tell us
Probably at the very minimum yeah
Nn idea what else they do
No game company shares the ins and outs of it's anti-cheat for obvious reasons
- Send Player Input and Physics State to server after physics has run. Do it unreliably.
- Server uses the last-received client input to continue it's own local simulation, but adopts the client state when it gets it.
@chrome bay By the way what do you mean by sending Physics State? Location/Rotation/Acceleration vectors?
Loc/Rot and velocities
So three FVectors and a Rotator normally
- whatever is required to drive the input of the simulation
how feasible do you think is it to handle physics which is server authoritative?
impossible
I meddled around for like a few days and lost interest lol
Total waste of time unless you're prepared to cope with the huge input lag
Impossible but RL is somehow doing it
RL?
is it because they've managed to make bullet physics engine somewhat deterministic?
Rocket League
Oh
No it's because they can afford to rewind and replay their entire physics scene
Which, if you can afford to do it is fine
But for anything more than a handful of physics objects or vehicles it doesn't scale.
No it's because they can afford to rewind and replay their entire physics scene
@chrome bay But how?
They have a talk on it, but the general gist is that they save the entire physics scene state into a buffer, then as the server gets packets from clients, it resimulates the whole physics scene with the updated input. I believe clients do the same.
I mean my question is: How come ACharacter is rewindable and replayable compared to physics objects? Isn't ACharacter movement also based off a primitive physics simulation?
That's very tightly bound such that it's rewindable
Because ACharacter is kinematic
not a physics sim
it's not part of the physics scene
Which is also why it's interaction with physics objects is horrible
Ie: physics objects just stop dead when colliding with character capsule
Chaos has a rewind API and the new network prediction system is going to interop with that, so the future is bright at least
But no indication as to how well it scales etc. yet in the real world
Sorry one more dumb question: What does kinematic mean in the context of movement in games?
https://www.youtube.com/watch?v=3HLvNu-j6eg Vid of upcoming Epic physics stuff
Dave Ratti said this to me on Youtube last week:
"We are still making progress but its never a straight path. I'm doing ground work on NP root motion / character movement while the physics team works on their end. Things will come together. Hopefully I can make a new video soon but my youtube career is low priority, relatively speaking π"
Kinematic means it's not a physics object, you set the transform explicitly. It isn't integrated by the physics engine with all other physics bodies.
Character Movement is basically it's own internal simulation that ultimately just sets the position and rotation of the character
But as far as the physics engine is concerned, it's an immovable capsule with infinite mass
That's great! Please do share. This stuff is pretty scarce on the internet lol
I think it's because Unreal does such a great job with replication of ACharacter, so it's all abstracted away
Yeah definitely
It's a bit of a shocker for most people when they realise it doesn't just work for anything
But yeah, this was insanely productive. Thanks so much, and do share your article!
I'll get to work on a client authoritative physics object and see how far I can make it
Np's
Yeah client auth is not too bad, and it looks "okay" for the most part
Definitely workable
Just need some basic sanity checks
Hey I need help with my ue4 multiplayer
I have replicated but now I don't know how will I be able to see whether the it's online or not
Help dude
I can see the changes on the screen but how to make online multiplayer I have only replicate till now
@twin juniper Please go to multiplayer settings and turn off Run Under Single Process.
Server authoritative physics are definitely possible, approach RL uses is great, it solves most of the collision issues that come with client side prediction. On a larger project there is no need to simulate the whole physics scene and every single objects, only the objects that are relevant (there is a possibility of interacting with) could be moved to a temporary physics scene to simulate, Physx immediate mode is also worth taking a look at. Nondeterministic nature of Physx can easily be covered up with a good smoothing algorithm and fixed timestep.
PhysX is for the most part deterministic enough, the real problem is the semi-fixed timestep. That's not going away until Chaos arrives. I've messed with approaches using intermediate mode, spooling up additional scenes etc, but it's far too complicated to be viable most of the time and doesn't scale very well.
The rewind API for Chaos will help a lot though, since it essentially handles the issue of replaying group of objects
yeah I'm very curious about Chaos built in support for rewinding
Multiple scene approach currently "works" but it can get complex
Yeah definitely not easy to do
A question is also: why would RL bother with server authoritative if they can do client authoritative with validation?
And then maybe build an anti cheat
I guess because ultimately you can only take validation so far
But also because it's a game that needs to be highly responsive
that network prediction plugin is huge
yeah it's mega. Even the non-physics stuff is an epic improvement over the current stuff
all in master branch too if people are feeling brave
Why would client authoritative not be highly responsive? Won't it technically be better
really want to see how performant it is. say 100 or so physics objects being resimulated
@near bison I guess the other issue is stuff like the ball, you'd constantly be seeing corrections as the ball veers off in different directions
Probably not a good fit for a game that's highly competitive like that too
Server authoritative physics are definitely possible, approach RL uses is great, it solves most of the collision issues that come with client side prediction. On a larger project there is no need to simulate the whole physics scene and every single objects, only the objects that are relevant (there is a possibility of interacting with) could be moved to a temporary physics scene to simulate, Physx immediate mode is also worth taking a look at. Nondeterministic nature of Physx can be easily be covered up with a good smoothing algorithm and fixed timestep.
@signal lance do you mean "issues with client authoritative" and not "client side prediction"? Because what RL is using is client side prediction
I mean client side prediction, with client side prediction one of the most difficult things to solve are collisions and RL approach of rewinding and replaying the whole physics scene solves that
By fixed timestep you mean fixed tickrate right?
Is there something to convert a client side to server side actor? I will explain better, in a rts the player will choose were to place the building that will probably be client side, when he choose the place the server will create the actual building but then there will be 2.
Is there a built in way or I do it manually by spawning one and once its replicated i delete the client side one?
Well you never spawn it client side.
You tell the Server to spawn it, then the client receives it via normal replication.
Yes but its a waste
the player could stop the building
while if the calculation are done client side i think its better
That's up to the Server to decide
If you want to spawn a network-relevant actor, it must be spawned server-side
There's no way around that
And something as significant as placing a building or something should definitely be handled by the Server ultimately
I heard quite a few reports that Chaos is in the current state around 5x slower than physx if not more, that's a bit worrying
Hopefully that won't be the case when it because fully production ready
The rigid body solver
Ultimately is the goal but not from the beginning
You can still do checks client-side, so that you don't pointlessly ask the server to build something you know you can't build.
You can still do checks client-side, so that you don't pointlessly ask the server to build something you know you can't build.
@chrome bay Yup but I want to spawn the building anyway with a green or red material
depending if they can build
Sure, you might have a preview on the client
But that wouldn't be the actual building object
exactly
That's how we do it in HLL anyway
Client shows a "ghost" actor as a preview and runs all the building checks, then they ask the server to build it.
Server runs the same checks, and the actor is either spawned or it isn't
99% of the time it is, and the object appears on the client a bit later
Definitly what im looking for but, is there anyway to somehow "wire" the two client and server buildings? Or do i need a RPC call like "Client_OnBuildingSpawned"
You don't need to do you?
to make it more automatic, idk if that makes sense
All you need to do is say to the server "pls spawn this"
and where to spawn it
Then the spawned actor is just a replicated actor
you never spawn one on the client in the first place
How do you make a ghost building then'
just have a preview
Once the client asks the server to spawn, they just kill the ghost there and then
spawn 1 for the preview and you could potentially reuse it by hiding it when requesting the server to spawn the real one
Once the client asks the server to spawn, they just kill the ghost there and then
@chrome bay Dont you wait for a response? It might look weird with a bigger latency? idk
Nah, works fine
Small degree of latency before the real thing appears but it's usually acceptable
no one is really gonna care about 0.1 seconds delay
I will try without any response
ty
no one is really gonna care about 0.1 seconds delay
@signal lance 0.1 in the best case
that's 100ms
i know
You can come up with some system that marks the ghost with an ID, and the server notifies the client if that particular spawn request fails
which is considered already "high" latency, actually the roundtrip time would be 0.2 then
Well i cant expect a 5k ping latency to play the game decently anyway
But it's a lot of hassle to hide a tiny gap π
i guess thats the way
You can come up with some system that marks the ghost with an ID, and the server notifies the client if that particular spawn request fails
@chrome bay I will try that one depending on the result, thanks
I see bigger problems @novel hemlock
Seems like you're overoptimizing
For no real gain
I see bigger problems @novel hemlock
Seems like you're overoptimizing
@near bison Considering you have the replicate also the movement and everything to maybe not even build it
and its net code
i think its fine
Fortnite for example (from what i can see playing it), the build is not instant (you feel a slight delay), but your preview is instant.
@meager spade can you explain i detail what do you mean by instant preview??
its like a Ghost wall (Preview Actor)
of the shape
then when you click to place, it tells the server spawn me this item
there is a delay before you see your actual wall tho
You can't move in Fortnite when placing things?
yeh you can
oops
thats the preview obvs that is instant
here is with 280 ping
you can see the delay in building
Yes this is significant lag
Im having a weird jitter issue with my character movement that only occurs in networking anyone who can help me? https://pastebin.com/Qg8ksGTd
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
NOOO TURN OF HOT RELOAD!
also use should use int32 or uint8 not int in RPC
and where are you changing the movement speed on the client?
yes but on server
yeah i missed it my bad π
and have you printed the result
of the speed?
both on client and server?
hmmm good one
Let me check
And why disable hot reload i dont even know what it does lmao
don't use the compile button in the editor
unless you want corrupted blueprints π
btw that is 100 percent correction
where client is moving different speed to server
and be corrected back
Yeah it looks like some rubberbanding and authority correcting it
that is what it is
bring up the console
and type p.NetShowCorrections 1
and it will draw any corrections
As i can see now the corrections only happen on state change
right which means your speeds are not synced
try using a break point
and see if that function actually gets called
ah it does in your video
you probably need to compile, close the editor, compile and reload the editor
Hello guys, I'm trying to create a LAN session and creaty it successfully. Once I Look for it (Find session) it finds a not valid session. Any ideas why?
Im creating them like this
@meager spade im starting to think it is something else... The jitter exists before the state has changed on the server
do you change the speed at all?
or have you changed any settings
in the CMC?
or do you have the skeletal mesh set to replicated?
if you set the mesh to replicated then turn that off.
check Component Replicates on the skeletal mesh
This is how i set speed
yes because i believe MaxWalkSpeed is not replicated
its not
did you check the replication of the skeletal mesh?
cause a lot of people turn it on, and get this kinda behaviour
this is on mesh
ok good, we can rule that out
open your char blueprint
grab the tick node
and print the maxwalkspeed from the movement component
so you have something like this
and see if server version matches the client version
when printed
yup
ok we can rule that out then
can you reproduce in a empty project and send me?
so i can take a look
Will take some time tho
Its so weird tho I had fixed this before and now its back somehow
Could it be possible a UE engine upgrade may have caused this?
I've found some info on the forums where some have the same exact issue, ill check those solutions out first
Hey, i'm trying to work on a VR Multiplayer game, how would i go about doing that?
I already have a character made with the motion controllers fully built in
I would also like to know how to debug a multiplayer VR game when there is only one headset plugged into the PC and you play as a listen server with another client in the editor. Nothing seems to work correctly. Is this not possible?
As a separate question: How do you replicate a static mesh component's size? For instance, I have a projectile that dynamically changes sizes during flight. I tried setting a property on the projectile and replicating the size that way with an OnRep function that changes the actual size of the projectile, but that appears to be choppy and inconsistent. Is there a better way?
you need to replicate the desired size
and interp to it on tick
replication does not happen every frame
Smart. I have the desired size but I was sending back the current server size.
Thanks for the quick response
Well in that case, I would love to not show up an owned projectile on the client, but projectiles are replicated so it shows up
so if the client has all the information to figure out what size the projectile should be
then you shouldn't replicate anything
I would rather just do the client spawning and launching the projectile
But how does the server know about other player projectiles?
you need to spawn it on the server to replicate it
Ok so I need the server to still own the projectile but sizing of it can be done locally
pretty much
well depends if other clients know what to size it too
that is all down to your code
if you set all that stuff when you spawn the projectile, then let the clients handle it all locally
basically, handle locally everything you can get away with
and never, ever, replicate the same information twice
Ok so if my projectile size is based on a timer then I could just hand back that event or timer and start doing local changes?
Right
but it changes the size as soon as it spawns and starts flying, no?
in a predictable manner
so you can just start a timeline on BeginPlay
on every client separately
resize it from there
(assuming its BP, i would definitely nothandle timeline from c++)
So I guess my question becomes: if the server spawns the projectile and it replicates back to the client owner, how does the client modify its size
It's C++
all machines run BeginPlay
all instances
so projectile replicates to client, replicated variables are set, it calls BeginPlay
on BeginPlay, you start resizing it
how it resizes is basically a property of the class default object
so clients are very aware of the parameters
they run the same BeginPlay/Tick code
Ok, so then my resize function must just not be working because I have it calling the same resize function on server as it does on client and server works fine but the client does not
I'll have to dig deeper then
I added an onrep variable to capture the server's size to replicate down to the client
all you really need to do is something like, Tick
Due to the fact that the client wasn't sizing it properly
SetScale(UKismetMathLibrary::VInterpToConst(GetScale(), FinalScale, DeltaTime, ResizeSpeed);
and let it run on server and all clients
(pseudocode there)
FinalScale and ResizeSpeed being constants on the CDO
Hmmm am I not able to run a timer on a client?
I'm wondering if that has something to do with it not working client side
Oh ok nevermind it is indeed working client side
It's the launch that I'm having issues with. Thanks for the help! I'll check back in if I have another issue with it
Doing what I'm not supposed to be doing - making a multiplayer RTS in UE4. Could use some help improving the bandwidth. Willing to pay a few hundred bucks for a working solution, more if significant time is involved. Watch the short video for a synopsis of the problem.
https://www.youtube.com/watch?v=qv7O9oYjMDU&feature=youtu.be
Movement updates overwhelmed in 3 player coop multiplayer RTS game, currently with non-dedicated servers. Testing with dedicated servers has yielded similar results.
@low helm dedicated or listen server, CMC for movement?
I'm hoping to do listen servers, though I have some experience setting up dedicated, I want this game to be very easy to maintain after release, so I'm hoping for clients to just host their own.
No character movement component, they are pawns with floating pawn movement, using the standard navigation system, a standard AIcontroller with behavior trees.
no c++ by the looks of it, blueprint only
Yeah I don't know C++, I can read it alright but only because I've worked so much with BP
there is more then one thing that can choke replication
server has a time limit on the CPU it can spend evaluating Actors for replication
btw, NetPriority 500 is crazy
yeah I know I got frustrated
it would take a minute for a normal Actor to panic enough to get replicated with 300 of those Pawns running around
did you run a NetProfiler?
no, I just kinda assumed a netprofiler would tell me the problem I already knew and not the solution, I know the skipping is due to replicated movement being overwhelming. But you're right I'll be a good boy and go lookup how to do that.
you don't know if you have a bandwidth problem, or you choked your CPU at this point
you sure? server game thread stays above 120
doesn't matter, it still has a limit on how much time can be spent on evaluating Actors for replication
it kinda sounds like I should be looking for ways to extend the servers allowance for evaluting actors for replication....
on listen servers, that is generally not a great idea
as they have to run the game client as well
and don't know what hardware are you using, but 120 FPS on gen 9 Ryzen CPU is not even 40 on a mid range gaming laptop
I will tell my players they just need to download more RAM. Or more accurately, the game SHOULD be pretty light weight beyond this particular concern.
what do those pawns replicate except movement?
There is a health variable and a team color variable, that's it atm
I've tested this with dedicated server chosen and the problem was the same
reconfiguring maximum bandwidth is easy
you just add a couple of lines in DefaultEngine.ini under OSS config
Ok?
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName=OnlineSubsystemSteam.SteamNetConnection
bNeverApplyNetworkEmulationSettings=true
MaxClientRate=25000
MaxInternetClientRate=25000
bClampListenServerTickRate=true
NetServerMaxTickRate=30
MaxNetTickRate=30
that is ours
Are those steam specific? I prefer to test through direct IP connection
no
its OSS config
in our cast its Steam
*case
having a TeamManager handling the entire team's worth of replication might help
but
blueprints are a very significant limitation here
basically, making a struct inheriting from FFastArraySerializerItem with all the replicated data and a pointer to a single Pawn, and replicating those via FFastArraySErializer
none of those are available from BP
simple way to test that would be to run a 20 or so of your Pikeman as a single Pawn
So in that setup the pawns would Replicate but not Replicate Movement?
and this single actor would replicate all their movement
its more complicated then that, Pawns wouldn't replicate at all
client would spawn them locally with a matching name, override of IsNameSupportedForNetworking would return true
so they remain NetAddresable
none of it is possible from BP
I see. Well you're welcome to build it for me if you think it'll make a big enough difference, I can't do that myself. Let me know if you're available and I can just send you the whole project. I pay with paypal.
The .ini changes didn't seem to do anything.
How do games like WC3 and SC handle unit replication, is it standard server authoritative?
Hmm, hi, I'm just a random person along with TEA. We're trying to make a game and are fairly new to UE4, however...we've been trying to get along with multi user editting, though we've never got it to work no matter what we did.
πππ
not familiar with how starcraft handles replication
Anyone good with math
Like really good
I wanna use line traces for bullets but I'm not sure how many parabolas or even how to go about it
I basically want bullet physics but with line traces
Use a curve, sample the curve at different points to determine where you want to place the Traces, perform the traces to each consecutive point until you define a linear falloff. π€·ββοΈ
The more samples, the more accurate the trajectory.
But the more expensive.
If your game is like CoD, i wouldnt bother doing complex trajectories. The sight lines are way way to small for it to be worth it.
Is there anyway to display Null subsystem sessions over net?
Any idea what could be causing client controller replicatec character rotation to stutter when moving on a even slightly sloped surface? When moving on plane the rotation is perfectly smooth
And for some reason looks like the rotation rate is a lot faster on sloped surface
Yeah just tested it with super slow rotation rate and when moving on slope the character rotates a lot faster and stutters π€
is there anyway to launch a headless client ?
I wanna do some server test and I need lots of clients 100+ . each client is taking lots of CPU + Memory already
I'm trying to generate server executable for a dedicated server
this is the doc I used: https://www.ue4community.wiki/dedicated-server-guide-(windows)-cny2avzu
the server.exe just isn't generating, tho it's compiling successfully
I'm using vs19
Guide on building Unreal Engine and project in the Dedicated server configuration.
did you package youur game?
ya
actually i think im thinking of the listen server from package trick rather than dedicated
Hi,
When I modify an array, my repnotify doesn't seem to fire.
if (InventoryInfo[i].Quantity == 0 && bFoundSlot) { InventoryInfo[i] = ItemToAdd; Success = true; return; }
is spawning about 30 actors in a frame too many for a networked game?
Depends how often
Depends on lots of other things too tbf
@woeful ferry If the array replicated?
Makes sure the client isn't modifying it, only the server should mess with replicated properties unless you know what you're doing
haha. well i ask because i'm trying to do kind of like a dynamic fire wall kind of thing, where i do a line trace down to the ground, and if it hits, i spawn a 100x100 actor in that spot. i think at the biggest spot it's up to 32 individual pieces, but when i do it as a listen server, i hitch super hard when they spawn, and if i do it as a client, it takes about 2 seconds before they all come into existence, starting from like 2 instances and then multiplying until it's all 32
literally the only thing i'm doing is pressing a key to tell the server i want to use the ability, the server does the 32 line traces, and then spawns the 32 actors
and it's incredibly slow, but it doesn't seem like it should be
@chrome bay The array is replicated and ran on server, however right now I'm only trying in singleplayer. And the documentation says it just runs on client, and if I play singleplayer I guess I have authority still and won't fire.
yeah they will probably take a while to arrive, def won't all come at the same time
Yeah that makes sense, rep notify will only fire when a var is actually replicated to a client
So it won't fire in standalone/offline
And it won't fire on the Server either
Blueprint rep notifies are stupid because they don't follow this
i see... might be better to maybe do some kind of spreading outward effect to make up for not being able to receive that much info at once then
So how would I go on about making it fire on the server too? I'm using listen server for our game.
thanks for the help!
I'll try and come back in a sec.
@plain musk The real trouble is you have no control over what order they arrive it so it'll be quite random
yeah that's what i've noticed. it looks super patchy when they're coming through
You probably want to combine that into one actor instead of 32 unique ones
spawning actors isn't cheap, especially in online
do you think it would be better to have a single actor spawn, let the server create collision boxes and then switch on authority and let the client create all the vfx? the client doesn't really need to know about the hitboxes, right? once they step in the server will tell them they're taking damage anyway
@chrome bay Works like a charm! ^^
It's up to you really - but you want to have a few actors as possible and if you can represent that actor in one actor but with more components I'd go about it that way
It's hard to judge not knowing what the end result is meant to be ofc
gotcha. i'll give that a go then. thanks for the insight!
(I'm assuming the components wouldn't be replicated btw also)
i think i can get away with only replicating the actor and then letting everything else get generated without replication
What you may need to do is have the actor have all the components by default, then just disable the ones you don't want using a bitfield on the actor or something
If you need those components to be network-relevant or characters to walk on them for example
hello, guys. where is the best place to insert DestroySession() for dedicated server?
right now it is in destructor of GameInstance
but i see what it have not enough time for sending request to online system
it need a little pause
If you want to shutdown cleanly you'd have to call DestroySession long before the game actually stops executing
And bind to the callback that confirms it was destroyed
All that being said - it's a dedicated server so it doesn't really matter does it?
it should unregister in EOS
Not used EOS but surely it should timeout
13 minutes timeout, yes
Bit of a fatal flaw if the server crashes and the OSS doesn't clean itself up
okey, thanks, it could help
Shutdown might be reasonable, but no idea
Does EOS not allow you to set a lower timeout?
13-15 mins is crazy
nope
urgh
Dedi cant be shut down by user input
So you have some wiggle room
Not like it has to cleanup on alt+f4
I've a strange issue I've just noticed.. remote players on machines with a low frame per second appear to have their pawn animated at the low fps.. Anyone any idea why this happens?
@soft shell By animated, do you mean skeletal mesh animation blueprint type animated?
Yes, that's running the animations
Animblueprints should only update once a frame I think. So if they have low framerate, all animations should look choppy.
Or are you meaning that they look choppy on someone else's machine?
My local machine is fast, 100+ fps and the remote (test) machine is 10fps.. When I look at the other players pawn from my machine, it's update looks like 10fps (not smooth)
Probably RPC calls that update the server's values that the faster machine uses. If one machine only changes their control rotation ten times a second, it'll only update on the server ten times a second.
Yeah; but this is literally looking at the pawn idling.. I would expect the idle animation just to run regardless of any RPC's at the full frame rate of my machine, I've no idea how it's seems like it's running just simple idle animations at the frame rate of the other machine
Sounds like an anim blueprint design issue. You're not doing any networking in it, are you? You should only be pulling that client's information for that client's version of the pawn for that animation blueprint.
There's nothing replicated in there; and the only time it really reaches out it to a pawn to get some information on what's being held (and that's just a get socket transform)
That's odd then. A simple idle animation on a 100 fps machine should play just fine at 100fps if the 10fps client isn't doing anything to cause the animation to play. You're polling the pawn for information, not sending information to the animblueprint?
Yeah; the pawn registers a component with it (what's in the hand), then in the anim BP I just get a socket transform on that component..
Unsure then, that's definitely not normal behavior. I could have seen it if your slow client was moving their mouse and it looked choppy on the faster client. But even movement should be mostly smooth with the way the CMC works.
We noticed the same problem
haven't had time to track it down yet
it probably has to do with CMC ticking the skeleton directly
(which it does)
CMC is short for?
character movement component
UCharacterMovementComponent::TickCharacterPose(); is the offender
It's done so that anim notifies etc. remain in sync with the network movement and such IIRC
CMC is a black pit of despair π¦
Ah, ok.. so it's just to be expected (and accepted?)
we will force ours to behave, but you can't do it from blueprints
Just move on and hope no players have that bad a machine (or turn down the graphics settings)
can't declare that the game is on production level until you fix that
It's a bit odd that they didn't make it optional tbh... since I'm sure that's the only reason for it
Code comments btw:
// If not playing root motion, tick animations after physics. We do this here to keep events, notifies, states and transitions in sync with client updates.
for us it will be easy fix, as we don't overly care for anim notifies being in sync
we use montages for pretty much everything
and they are in sync
To be fair, if your game is running at 10fps on a machine, it's probably not being ran on a machine for your target audience.
there is always someone with a gaming laptop from 2004
that knows it won't perform well, but is going to try
problem is, others see the animation as choppy
so game looks like its not performing on other, high end machines as well
Yeah it's going to be affected by how often the server is receiving those packets from the client too..
Can't wait to see the back of character movement...
and when everything is smooth except that one guy with laggy animations
you can't really see anything except that animation while you're playing
it stands out, badly
so you can't dismiss it, you have to fix it
yeah.. I actually don't know why we don't have this issue now
Actually. Speaking of FPS networking stuff. Do either of you know how to force the editor to keep it's FPS up while you're running a second window not in the same process?
Since the editor kills it's framerate when it's not focus in any window.
Yeah it's in the editor settings somewhere
Ah, there we go, that's why I couldn't find it. Was looking for FPS or Framerate. "Use less CPU when in Background"
Nice find, kinda need that myself
@soft shell Ah. Thanks to Jambax I at least found the reason I haven't noticed this til now. This issue only applies to the character's default skeletalmesh, which on my character is only owner see(So only the slow client would see it). the mesh others see is a separate component. If you add a separate skeletalmeshcomponent to your character, the animation issue goes away, but the movement is still a bit jumpy.
Ah interesting! Thanks for the insite
The default "Mesh" property in characters is the one you should use for third-person perspective as that's the one that has the positional smoothing etc and such
the First-person mesh like arms or something would be a different property
Usually the FPP mesh is moved to just project out from the camera too
take a look at ShooterGame for the setup
Speaking of seamless travel, is there any way on a client to delay it - to play an animation or something ?
It's a problem I've to "fix too"; my clients get in too early and are stuck at camera 0,0,0 (before the local controller is created).. why are you wanting to delay it?
Hello, I recently upgraded my project to 4.25, from 4.22. My dedicated server won't launch, and I have this dump file, should my game say 4.25 instead of 4.22.3?
You should be able to dig further by debugging it natively (option that's should be on the top right of the screen, but is cut off)
Normally if you can kind your PDB file (VC is want it) then you can see in the call stack where it died
oh thanks, I don't use VS much, I made my project in BP
Are you using plugins? It's possible one of those might need updating
oh, let me check
hey guys, need some help replicating animMontage's , need some advice on RPC's, i tried to figure it out, did on repNotify but none cliets see's and animations are jagged
ok I might have found a couple issues, we will see how it goes
is that code in the rep notify variable or in a multicast RPC
If you only want people in view distance to see it, but not replicate later when people come in, shouldn't it be just a multicast RPC?
Or do you want ppl to see the animation though when they come into range at a later time?
If this is a pawn, the client could have authority
so you would need to go from the pawn, to server, to multicast I think
@bitter oriole overriding ClientTravel should do the trick
you execute the Super after the animation
Cool, thanks
not sure what's virtual there though
Why aren't TMaps replicated? I can make a replicated struct that achieves the same functionality pretty easily
would take some effort to net serialize a tmap in a generic way
maps and sets are a no go for replication
Right, was just curious why, considering maps are so damn useful
doing it for your specific use case is trivial
generatekey/value arrays, (de)serialize those, reassamble map on deserialization
in NetSerialize override
problems arise if your key is a replicated pointer
and NetGUIDs for some of them haven't been resolved on clients
then you have a map with duplicate keys upon deserialization
which is not good
and i don't see a way to solve that particular issue
What's up guys, how's it going? I made a pump system, but I did everything on the character. The character who places the bomb can disarm, but another character cannot disarm, only if the bomb is planted by him. I know it's confusing, if you want a video call me, that I send!
not much, trying to figure out why my server build is doing 32 bit. When I do development editor it runs 64
first time I've encountered the error
Hi all, hope everyone's doing good.
When you connect to a dedicated server, does PlayerState::PlayerName get carried over from client to the server, and then back to other clients? For example, if I have two players logged onto Steam and their names are A and B, once they connect to my server can A see the other player as B and vice versa?
@limber mortar hmm random shot in the dark, maybe try adding [SupportedPlatforms("Win64")] before "public class" ?
but it would not also be the first time VS decides to do something wonky that you don't want
I used BP and am not a dev by trade
so could be
I'll try to put that in
and see what happens
same result
let me try one more thing
ya, same message even with supported platforms in
OMG
Yipee!
once I see the exe - log run I will do a dance
[Question] A virtual function just means that children can override it right? but you can also still do your logic in THAT classes c++ file right?
woops
wrong chat
I was able to launch my dedicated server, then launch my game and join
The compilation process is now working like it was in 4.22 thanks for all the help
Does anyone know why 4.24.x and 4.25.x have a lot of network corrections (p.NetShowCorrections 1) when just moving around with a blank project? 4.19, 4.20, 4.21, 4.22 and 4.23 don't have network correction issues. What changed because changes to the character movement component doesn't seem to be the issue? 
Not sure, I'm not getting many in 4.25.1
@twin juniper Weird. Creating a new Third Person Template/C++ project using a dedicated server, I can get a lot of corrections just by rotating my character. Didn't happen in 4.19 - 4.23 even with pktlag of 100ms to 500ms.
Currently with no simulated lag I actually get zero corrections from basic movement/rotation. Will test with lag
600ms lag (clumsy) I get no corrections either
@twin juniper in 4.25.1 you get no corrections just to make sure I understand.
Yep 4.25.1 no corrections for basic movement/rotation unless I am alt-tabbing or something. I do get a lot of corrections for some of my custom events but those are an issue on my end
Are you using 'Play As Client' ?
yes of course
assume my tests are accurate as I can get spammed with corrections when I simulate high packet loss
maybe you have a firewall/antivirus issue? idk.
I have firewall and AV off for now. I've replicated it on 3 machines. :/
this is what I am seeing on 4.25.3 with no lag.
So when I test my game with multiplayer PIE, everything works just fine. But when I do a playtest via Steam (using just Spacewar app ID), I have some really random bugs such as one piece of the UI not showing up. Any ideas where to start debugging? Surely using the default App ID wouldn't have an effect on any of my gameplay code?
@twin juniper Thanks for checking it out. I still don't understand how I get those corrections on 4.24.x and 4.25.x, but not on 4.19.x through 4.23.x It's weird.
I'm trying to reproduce this error / message in the editor but I don't see it in the logs. Only when I build a dedicated server. Anyone know how I do this? π¦
I don't want to cook, compile, package each time to attempt a fix
Hey guys, anyone know why I recieve some invalid sessions while looking for them but can still join to them regardless?
My clients are eventually hitting a Reliable Buffer Overflow. My game is far from a completed project, so I was expecting to add way more reliable RPCs in the future. Of course that's not gonna work. Are there any workarounds like increasing the buffer size?
I will start aggressively reducing the amount of Reliable RPCs that already exist in my project, but how can I tell "ok, this is enough reliable things" looking into the future?
Is this even a common problem to face? Or I am doing things way too wrong
well, what RPC's are you sending
cause normal UE4 stuff doesn't ever hit the RPC buffer
so are you sending reliable RPC's on tick?
that would be the only way you would overflow that buffer
That was another doubt I had. Only realiable RPCs can cause this issue right?
so are you sending reliable RPC's on tick?
@meager spade I'll have to double check. I hope I am, then this problem will become much easier to solve π
But from what you say, I understand that this is by no means a common problem to deal with
i mean you should limit your reliable RPC's to cruicial things that must happen, and you can't afford to miss them
Yeah, likely someone from the art team did some tick based Reliable RPC thing
Do you happen to know how many stacked RPCs are enough to overflow?
A vague approximate
Is it in the order of 10? 100? 1000?
you can increase the max rpc per netupdate
not sure if that will fix the reliable buffer issue
net.MaxRPCPerNetUpdate=10```
do you know what log I need to look at, in the editor, to see what a dedicated server would say?
I'm trying to troubleshoot a warning I only see once packaged and running
I'll try some more googles
@limber mortar You can set the level of warning for different things, if you were not aware maybe it is a good place to start
Maybe that log category is disabled by default on everything but packaged buids
I'm not necessarily concerned about the warning
I just don't know how much it effects my game
This function is called multiple times a tick
I'd rather eliminate the warning, it wasn't present in 4.22
Like if that function is called 200 times per tick, and adds X amount of time figuring out it is improper, how much time is added each second
I'll mess with it tomorrow
I fixed a hundred other things with going from 4.22 to 4.25 the last few days, I need a break
Have a nap and a twix
Anyone ever saw a Reliable client RPC fail to run in some cases ?
I'm calling one on PlayerController from AXXGameMode::RestartPlayer and it sometimes doesn't run on the client
whats the scenario @bitter oriole ?
Basically the game mode tells the player controller to read a save file so that the player sends another RPC the other way round
where are you calling it from?
i mean, it could be ridiculously early for an RPC
but you do know of an RPC that never fails and is called on very start, its ClientInitializeHUD
anything after that, and it shouldn't ever fail
Alright, let me try that. Sorry for the high answer latency here, there is a baby in this place
I do think it's just too early to call - right in RestartPlayer in game mode base
normal call to RestartPlayer happens after that
from HandleStartingNewPlayer, which comes just after GenericPlayerInitialization that sends the RPC for the InitHUD
Thanks a bunch
How can i increase and maybe check inside the editor the bandwidth? I tried many settings inside .ini files i found on internet but those don't seem to work for me
What's up guys, how are you? I made a bomb system, like CSGO, with line trace, but I did everything on the character. The character who places the bomb can defuse, but another character cannot defuse, only if the bomb is planted by him. I know it's confusing, if you want a video, I send it!
I have a weird one. A pawn is supposed to exist on the server only, and this works fine as intended. Replication obviously off.
However, the moment I spawn an AIcontroller for this pawn, it replicates a version of the pawn down to the clients against my wishes.....
Hey guys, anyone knows why I can find invalid sessions but still be able to joint them? I'm using steam, but it seems weird to me.
i want to ask for help in this server,
2 year trying doing it and still i am nowhere , done aws to and to hard for me
i want my game to be simple, maybe with steam
imaggion u as gamer...
u download(steam) <<---example, u install, u create acc/login (with steam) <<--again example , u start at a fixed place in the game - u play u level up u gain items = u exit - u login - u are at same place like last login - there are people to playing that session that is automaticily made, help please
[16:09]
imagen* :p
What's up guys, how are you? I made a bomb system, like CSGO, with line trace, but I did everything on the character. The character who places the bomb can defuse, but another character cannot defuse, only if the bomb is planted by him. I know it's confusing, if you want a video, I send it!
@empty matrix how does the second character try to reference the bomb? send a picture of the logic coming right after the line trace
it's unclear what you're asking
Do you want me to send a video?
k
Ok. How do you know the bomb isn't being defused?
Do we still need to built the editor from source for a dedicated server build to work?
yeah
@wicked nimbus yeah I think that hasn't changed
Thanks;
Anybody know why my AIController causes its pawn to replicate to clients against my will, even though the pawn has replication off?
why would you not want the pawn replicated?
Doing a proxy system where pawns are moved around by a single actor replicating an array of vectors
for an RTS, saves bandwidth
works real nice, but it creates this insane problem where the mere act of spawning a controller causes the pawn to replicate, even though "replicates" remains off
I can't even destroy it on client side, because it's replicating
Did you try the method tearoff?
I'm a BP only guy, don't know what that means
actors have tearoff method/function that remove the replication
I use it to not replicate a ghost building when i spawn it
Doing it that way also means you can't refer to any of those actors through RPC's or replication
Since you can't resolve them
Yeah I know they just use integer ID's on a map
it's all working really great, way more performant than standard replication
but it won't let me run a controller on the server without automatically shoving the pawn down to the client
it's all working really great, way more performant than standard replication
@low helm Would you mind giving me some hints? I'm doing an RTS aswell and its reeealy hard to replicate them all
I had to increase the bandwidth to around 80k to replicate 140 actors?
but its still not good
Use dormancy and lower network update rates
@chrome bay The problem is that on the client that isnt smooth, if the troops are all on screen
Using standard replication on an rts +100 troops its not good at all
So what happens when you want a replicted property on one of those actors?
You have to route that through your one replicated actor?
Well I don't know about making a super responsive RTS, I'm making something reasonably slow paced so the unit positions will be a little off.
All I'm really doing is multicasting all the unit positions through one array 10 times per second. I use the GameState to do this. Unit's have Integer ID's and are looked up in a Map.
Client's receive this information and instead of setting their actor location to the location receive, they LERP themselves towards the destination they're told to be at. I tried it yesterday with up to 1000 blocks moving smoothly, though that did start to hamper CPU in editor, there were no bandwidth related hitches like you would normally see with Unreal's replication system.
Yeah any replicated properties need to be sent through the ID system, basically some events on the Game State
it's purely experimental for me, I'm only 2 days into this approach, but early testing suggests huge improvements
All I'm really doing is multicasting all the unit positions through one array 10 times per second.
@low helm so your basically doing the job of replication but worse...
Sending massive amounts of redundant data, and with no ability to prioritise actors
Doesn't seem like a very flexible way of working to me. Going to hit a ceiling very quickly
@chrome bay dormancy and net update rates are not solutions to this problem. an RTS has to be able to function with every unit on the map conceivably moving simultaneously, and the very act of determining which actors should be dormant is one of the causes for the hitches in the first place
You can do that without having to use the engines replicated movement, quite happily
The ceiling for replicated actors using standard replication is about 40 before bandwidth is overwhelmed
Using a centralized movement event, I got it up to 1000
I wouldn't use Unreal's standard replication system to do an RTS of that scale.
We've got well over 800 in a 100-player FPS
40 replicated actors is not many, but character movement will slow you down a lot
and/or any use of physics since the transform changes constantly
All I wanted to do was make an RTS with 120 units total, I was trying to be humble, but the standard replication couldn't even handle that
It definitely can
I would probably use simplified, deterministic physics with a lock step sync network setup.
Without physics and with a netupdate rate of 4, I still can't get close to 100
I would probably use simplified, deterministic physics with a lock step sync network setup.
@foggy hinge Not easy at all on UE4
It's not easy, but it is doable.
You won't get to 100 easily, but it can be done. But anything is better than multicasting a huge array of data 10 times a second
Have you actually profiled it to see what's taking up the time?
https://youtu.be/Y733GJnatpc?list=PLoozKjrfzhYaawZ8dNIkHP-US5Ddj5BC8&t=49 490 replicated actors here, ~1.2kbps peak
Other RTS engines like Starcraft, Warcraft, Age of Empires do the above. Instead of replicating individual unit positions, you replicate player commands instead. Since the game is lock stepped and synchronised, you don't get terrible problems.
Ok. How do you know the bomb isn't being defused?
@low helm I will send a video
Might be relevant btw:
https://www.youtube.com/watch?v=VusAHXoHF3Y
You can still do it the UE4 way if you really want; but I wouldn't try to make a Supreme Commander doing it that way π
I'm basically a one man team, lock stepping is out of the question.
Would be nice if Epic deigned to release some generalized support for RTS in the engine
RTS movement is usually quite simple right? If a unit moves, replicate the path points and the "time" the move started
Then have clients interp the objects along the path points from that time
That doesn't work because of collisions, unless you have no collisions
IDK there's probably a few things to try, but I'm willing to bet there be dragons trying to have non-replicated replicated actors
Blueprint has maybe <30% of the good stuff when it comes to Multiplayer unfortunately
Last time I made an RTS, I made the units have no collision
RTS is always hard-mode multiplayer
Ye probably without collision between each other is better
It was just annoying, you can get that behaviour by using some flocking with ROI for units
And then improve the path finding for units
Since you never directly control the movement of units, it would look like they had collision by avoiding things instead
@low helm
Saw someone talk about the new prediction plugin earlier, anyone played with it already ?
@novel hemlock hory shet, tear off is an actual node. I'm sorry I overlooked your genius. Tearoff on the pawn at beginplay seemed to work, thanks
I was looking for it as a property
@novel hemlock hory shet, tear off is an actual node. I'm sorry I overlooked your genius. Tearoff on the pawn at beginplay seemed to work, thanks
@low helm Lmao ye I was not joking, I use it right after spawning my building
Hey! I heard Epic are making some pretty significant changes to the character movement RPC system from a pull request I've been following. "Thank you for submitting your pull request, however, a refactor of character network RPCs went out in 4.26 which does this already, as well as fixing some RPC ordering issues."
Anyone know what's up? It'll likely be way better than my custom solution ( it works for me, but I'm keen for an official update!).
Basically refers to extending the amount of info you send via the server move functions and whatnot, due to the current flags system being kinda limited in size . Kinda forced you to create your own methods to achieve more advanced movement.
@polar wing i think they made some signification progress in NetworkPrediction and its coming very early than what I predicted.
@rich ridge does that mean NetworkPrediction may be coming in 4.26?
as per the @polar wing comments it seems like that only
and 4.26 is delayed for indefinite time.
by this time epic should have relased preview of 4,26
oh, I thought it was coming out before the end of the year
ah well, that's a little disappointing
I've been having replication issues with movement since 4.24 and I was hoping 4.26 would solve it
can follow updates on NetworkPrediction here https://github.com/EpicGames/UnrealEngine/tree/master/Engine/Plugins/Runtime/NetworkPrediction
yes i have been following the same when NetworkPrediction was announced
can't wait for network prediction, really hoping that's coming in 4.26. They will likely keep CMC going for backwards compat too, hence the improvements (my best guess).
Anyone knows why I get invalid sessions while looking for them but can still join regardless?
Hi, i watch the Unreal multiplayer Master tutorials from game dev.tv and i am at the end of the puzzle tutorials, but im Not really happy with the result, the moving Platform is very laggy on the Client and smoothly on server. If i command out the if(authority() in tick, its smoother on Client but allways a little laggy. One year ago i had a little bit the Same issue, by a jump ability the location on server and the location on Client was Not the Same so the server try to override the location every tick and a laggy jump was the result, now after my programming break i cant remember how i solve it π and i think its kinda like the same Problem here, can anyone help, maybe i am also wrong with my thesis?... Sorry for Bad english hope you All can understand what i mean π i read some about role simulated proxy, so the movement would extrapolate from the velocity, so i Set it up but it dosnt habe the Effekt. i am New to multiplayer programming π₯Ί
The photos are decent tho
guys, how can I configure the editor to run two users, one has authority (server) and the others are remote (clients). Without exporting the game all the time
set net mode to Listen Server and add more than 1 player
ah shit that was easy, so the first one is the server and the rest are clients. Thanks @twin juniper ! β€οΈ
Hey guys, anyone has used the Advanced Sessions plugin? I'm trying to use the extra settings and get and empty Extra settings array. Can join normally to the session tho.
Can anyone give me an overview of when to override FSavedMove_Character and FNetworkPredictionData_Character (and what the advantages of doing so are)
(or even just some documentation is good, haven't had much luck with google)
@gilded vapor You typically have to do it for every movement ability you want to implement (well, you override it once and then just keep adding stuff to it, but it has its limitations), such as sprinting, dashes, etc, to keep things silky smooth between the server and clients. Here's a great vid that will get you started. It's the one I usually point people to. https://youtu.be/Of8SGBa3WvU
There are improvements coming that will make things better, but the release date is unknown. This is all we have for now, but luckily your actual functionality is reusable, even if you switch over to the improved movement replication system later.
In this video I show the proper way to make movement abilities for your characters. This is done by creating a Custom CharacterMovementComponent.
We start from scratch with a third person BP project, but here is the completed project you can copy code from: https://drive.go...
@polar wing awesome thankyou that's just what I've been looking for!
glad to help! Starting off with MP in UE4 can be a little confusing. It feels like there's a lot of secret sauce that people aren't willing to share π€£ .
Definately, I googled what does FNetwork_Prediction do and the first link is a post asking "does anyone have any documentation for FNetwork_Prediction" without any responses haha
chat history of this channel makes a pretty complete, albeit unordered, network docs
If I spawn an actor on the server (projectile) and I want to set a property on a local client to that server spawned actor how do I go about doing so?
make it replicated and set it OwnerOnly?
Hmm, so if I spawn an actor on the server and it's replicated, it will show on all clients no matter what correct? If I then assign that actor to say a property on a character that is Replicated and DOREPLIFETIME_CONDITION is set to say SimulatedOnly then it won't be shown to all clients?
Or in the case of what you said, OwnerOnly, then it will only replicate to the owner and not all clients?
I guess what I'm trying to figure out is what is the best practice for spawning a replicated projectile. Should I be spawning them on the server for all proxies but for the owning client I do my own local version?
Right now I have it set up to spawn the projectile on the server and when I launch it I call launch on the server as well, but I don't hear the launch sounds on the client probably because it's only calling launch on the server. Does that mean I need to separate the sounds logic out and make sure that gets called no matter what on both server and client but the projectile movement is the only thing getting called on the server?
you need to do as much client side as possible
or multicast the sounds
i use the ability system
so client side i play the spawn cue, then server plays spawn cue which replicates to all clients
I have done research online from someone saying multicast should be very limited, so I was trying to not use it as much as possible
same as muzzle flash, etc
this is the perfect use for a multicast tho
multicast are for one off things
and should be used for things like that
don't listen to the nonsense
But as you just said, you could get away with playing the sound locally and then telling the server to do it as well
probably same people that say, "Don't ever use tick"
yes but other players (simulated) won't hear the sound
so you will need to multicast that
or they will just get shot by a projectile and never hear it fire
Oh really? I thought that when I started a sound on the server, my client was picking up on it
sound is not replicated by default
Right, but if you have an actor which is set to replicate and it has say an audio component and you call audiocomponent->PlaySound() that wouldn't replicate? For some reason my server side character presses the charge button and i go to client and I hear the charge sound
And nothing is multicasted
I'll give it a test. So you're saying every single sound needs to be a multicast then?
or via a client rpc or a replicated property, yes
same as particle
unless you play the sound on BeginPlay
of the projectile
then clients will hear it
as BeginPlay is called on all
Ahh that is why I hear it then
When you said you play the cue client side and then server side multicast to all
Wouldn't that double the sound to owning client?
no
Gameplay Cues don't go back to owning client on predicted abilities
theres a check in the Multicast to prevent it
so the client hears the firing sound and muzzle flash instantly
Ok. I was just reading that some senior networking programmer was saying to try and avoid multicast unless he was sending say some server message to all clients. He was saying to use OnReplicated callbacks and just set bools for events instead.
OnRep/RepNotify is for state things
multicast should be for one time things
if it was that much of an issue, then why does Fortnite use them so much?
as they use Multicast for most effects (including weapon shots and muzzle flashes/sounds)
Ahh ok interesting
So do you happen to know then how to launch a projectile? If I spawn it on the server and call a server RPC to launch it on the server, should I also be calling a multicast to call launch on the client as well?
But if you have lag then you will click and no projectile will come out for however many seconds that way?
I would think you would want to spawn a local version for owning clients and not show the replicated one so you could shoot your client side version
Just as you said you play a local sound and then the other clients get the multicast one
i just smoke and mirror it
i don't bother with local client projectile
just hide it behind the muzzle flash lol
Ok. So if Iβm the client and I call a server RPC, spawn the projectile, and then want to call some functions on that spawned projectile from the client, how can I set the owning actorβs projectile property to the server spawned actor?
Meaning the non server client needs a reference to the server replicated projectile. Am I good to just say property = spawned actor when the RPC calls and then make sure that property is replicated?
I'm sorry for all of these questions I'm just trying to wrap my head around actor replication and actions and you're helping me a lot so thank you in advance.
So basically what I think I'm hearing is that I should break out my sound calls into a single multicast RPC called from the server, change the projectile velocity on the server itself and then do nothing client side?
@steel vault The client basically doesn't get word of the creation of the object until it gets first replicated to the client, and for that you're looking at the Begin Play of the object
Isn't the owner of a replicated actor replicated to clients? If so, and if the client really needs to access this object, then I would probably have the object register itself at begin play with a gate before like Get Owner = Player Controller ---> If True, register myself as the projectile being sent variable with whatever client sided object was trying to keep track of me.
I'm sorry, I'm a little lost with what you are saying.
I'm 90% sure you can simply send the newly spawned projectile as a parameter in an RPC from the server to client, right after you spawn it
such as: ```c++
if (GetLocalRole() == Role_Authority)
{
AActor* BulletProjectile = GetWorld()->SpawnActor();
ClientDoSomethingRPC(BulletProjectile);
}
assuming everything lines of reliably (untested)
So you're saying to multicast it? Usually RPC's go from client to server unless it's a multicast I thought.
I believe in UE 'RPC' is the base term for remote functions and Client/Server/NetMulticast are different categories of RPC
Ahh yes I see now. What was said earlier about BeginPlay being called on all clients, I would think that is the perfect place to assign it to the character's property, but I don't think it was working that way
Like spawn actor on server, set character property to actor, but I was getting nullptr for the property on the client side I believe. Will have to try again tomorrow morning.
is it ok to use json to communicate with item database to load player inventories
is it possible to make rpc calls for dispatcher events?
i do not know... but so far i just feed my rpc's into a dispatcher.. either on the server or client or multicast.. right when it comes out of the rpc.. it triggers an event dispatcher
@strong vapor if you dont mind can you show me how you set up your blueprint with a image?
sure
i've been debating on changing my death logic to being from a replicated variable.. but that's how its set up now
and then all the clients have stuff that binds to that event
ty, yeup thats basically how i set it up. the only difference is my that my dispatcher binds assigned in the level bp. maybe that is bad design?
i mean.. if your game is single player.. i dont see why it would be bad?
if you're doing singleplayer, why are yo doing rpcs?
How do I understand in NetSerialize method in struct if I'm receiving data or sending?
Or It's just to send/pack data?
ar.isLoading() and ar.IsSaving() ?
I saw those while I watched at some struct like the movement rep or rotation etc..
But I don't know, many don't have a clear distinction, its not a if(isLoading), it seems like they compress anyway and eventually decompess data
Damn so hard to find informations on UE4, I miss Unity just for that
IsLoading() means it's being deserialized, IsSaving() means it's being serialized
Saving = being sent, loading = being received
Sometimes you can follow the same code path for both due to the way the serialize methods work
or if it's just more convenient
Sometimes you can follow the same code path for both due to the way the serialize methods work
@chrome bay isnt there any overhead to do both every time you need to performe one of the 2 actions?
Nah internally some of the operators and such know if the archive is saving and loading and writes/reads accordingly
Like the << operator overloads
Of if you look internally at what SerializeBits() does etc.
Oh cool, I will look into that
does anyone have a tutorial about how to use the OnlineFramework plugin or how to use lobby/party beacons? Actually any information would help.
@meager spade Haha, had no idea multicast was used so liberally in Fortnite. Might need to rethink how I handle my stuff.
Hereβs an interesting problem. If you spawn a server side actor so it automatically replicates its position to clients and then send it off at a high velocity say 2000 in a direction, the server sees it better because it seems to update the position more often/more frames but the client sees it less frames and it looks skippy almost. Is there a fix for this by increasing server tick rate or is the proper fix to multicast the spawning of the actor so the clients own their own version?
And then maybe just replicate only the position of the actor i stead of the entire thing and interp the client side position to match the server one?
if the velocity is predictable at the time of spawning
you put a replicated vector with velocity as a replicated variable
do not replicate the actors position in any way
projectile movement works fine for me i don't even do that
and just launchn it with velocity on clients/server separately
unless you want to dynamically adjust the velocity, just mark it replicated, (expose on spawn if its a bp node), spawn it deffered, set the velocity, then call finishspawning
