#multiplayer
1 messages Β· Page 18 of 1
you know what
I actually had this issue too
with hosted sessions showing 9999s ping in the server search result
so I just disabled ping showing there
I don't know how to fix it
the ping showed fine for dedicated servers
given that a lot of houses in my country are still on ADSL2 its probably not that far fetched for listen servers
but I was in the same room
with the 2 pcs
lol
and once I logged in to the server
the ping showed fine
and it ran fine
just a menu issue
probably an OSS issue then?
Idk what oss is
online subsystem
I mean the issue is with the search result thing
yea maybe with the advanced sessions plugin or that
I'm lobbying over the lan, it shouldn't show that much ping
it's a bug in the engine
just hide the ping there
can't we find the real ping π @past totem
sounds kinda pointless,
too much trouble than it's worth
but if u figure it out, by all means, let me know so I Can fix in my project too

So how can I get him to join the session directly when I say invite him to the game via steam? @past totem
I don't know why you are pinging me
but if u use advanced sessions there is an event for it in the game instance
but when I tried it was kinda weird for me not really working Idk maybe steam is just bugged Idk
finally i have a problem
this is your third
Once someone has established or joined a session, they cannot create or connect to a second session.
always call destroy session before u call join session
are you experiencing this? I cannot establish a new session without entering and exiting the game.
hmm
I'm an experiment
@past totem
why doesn't this work:
public:
UFUNCTION(Exec)
void Join(FString ipAddress);
UFUNCTION(Server, Reliable)
void Test();
void UMyGameInstance::Join(FString ipAddress)
{
UEngine* engine = GetEngine();
if(engine)
{
engine->AddOnScreenDebugMessage(0, 2, FColor::Green, FString::Printf(TEXT("Joining %s"), *ipAddress));
Test();
}
}
void UMyGameInstance::Test()
{
UEngine* engine = GetEngine();
if(engine)
{
engine->AddOnScreenDebugMessage(0, 18, FColor::Green, TEXT("THIS SHOULD WORK ON THE SERVER ONLY"));
}
}
this is the error:
CompilerResultsLog: Error: MyGameInstance.gen.cpp.obj : error LNK2005: "public: void __cdecl UMyGameInstance::Test(void)" (?Test@UMyGameInstance@@QEAAXXZ) already defined in MyGameInstance.cpp.obj
CompilerResultsLog: Error: MyGameInstance.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UMyGameInstance::Test_Implementation(void)" (?Test_Implementation@UMyGameInstance@@UEAAXXZ)
CompilerResultsLog: Error: MyGameInstance.gen.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UMyGameInstance::Test_Implementation(void)" (?Test_Implementation@UMyGameInstance@@UEAAXXZ)
PuzzlePlatforms\Binaries\Win64\UnrealEditor-PuzzlePlatforms-5313.dll : fatal error LNK1120: 1 unresolved externals
@limber cloak should be Test_Implementation() in the cpp instead of just Test()
ohhh thank you very much, im coming from unity3d and the documentations are not the best
No problem βΊ
why does the code run only on client?
UFUNCTION(Exec)
void StartFunctionOnServer();
UFUNCTION(Server, Reliable)
void Server_Test();
void Server_Test_Implementation();
void UMyGameInstance::StartFunctionOnServer()
{
Server_Test_Implementation();
}
void UMyGameInstance::Test_Implementation()
{
TArray<AActor*> allActors;
UGameplayStatics::GetAllActorsOfClass(this, AMovingPlatform::StaticClass(), allActors);
for(AActor* theActor : allActors)
{
UStaticMeshComponent* theComp = theActor->FindComponentByClass<UStaticMeshComponent>();
if(theComp)
{
theComp->DestroyComponent();
}
}
}
If this actor is a child class of GameInstance, then the Game Instance only exists on the instance of the game that is running. So the server can have its game instance, the client(s) each have their own but there is no replication of Game Instance happening so you can't RPC through them.
ahhh ok thanks
It only runs on the client, idk why. I want that the client tells the server to run this code, not the client
Here is what I did:
private:
UFUNCTION(Server, Reliable)
void Test();
void Test_Implementation();
void AMovingPlatform::BeginPlay()
{
Super::BeginPlay();
//if it is client, then tell the server to run the function, if its server, then do nothing
if(!GetWorld()->IsServer())
{
Test_Implementation();
}
}
void AMovingPlatform::Test_Implementation()
{
UStaticMeshComponent* theComp = FindComponentByClass<UStaticMeshComponent>();
if(theComp)
{
theComp->DestroyComponent();
}
}
Assuming this actor is made to replicate, and is spawned by the server or placed in the level, RPCs cannot be made through this platform unless it is owned by the client.
how do I make it be owned by the client?
Also 1 more question, if an actor or a pawn is not owned by a client, the code wont run at all on the client or?
You can have code run on an actor that isn't client owned, but you cannot have the client call RPCs to the server through it to run code.
For example, if you had an "else" on your if(!GetWorld()->IsServer()), then the code in that else would only run on the server.
yea I forgot to SetReplicates(true); after I did that, it crashed the engine. Probobly because it was an actor, not a pawn
Actors can replicate no problem.
Yes I understand that, but i want to learn how to Command the server
In fact if you want something to replicate, it basically has to be an actor.
Any time you want a client to tell the server to do something, you're usually better off doing through a player owned actor, such as the player controller, their controlled pawn, or their playerstate, or anything that is owned by those three. You can change ownership of actors on the server to allow a client to RPC through them, but it doesn't make sense to if it's just a small thing, like say opening a door.
for example, there is this 1 actor(not pawn) its a simple moving platform. I can't use inputs in it, cuz its not a pawn, but if i use linetrace will it work then?
if i do like linetrace get the actor and then call the function from that actor
to command the server
If you're wanting the client to control the platform, then yes, something like that.
So something like, client presses button on their character/player controller, does a line trace, hits the platform actor, if hit actor is valid, runs an RPC to the server on the player controller/character passing along a reference to the actor that was hit, while running on the server you can use an interface to that actor (or cast, or however you need) to run a function on that actor.
can someone figure out, why this isn't working?:
public:
UFUNCTION(Server, Reliable)
void Test();
void Test_Implementation();
void AMovingPlatform::Test_Implementation()
{
//if(!GetWorld()->IsServer()){return;}
UStaticMeshComponent* theComp = FindComponentByClass<UStaticMeshComponent>();
if(theComp)
{
theComp->DestroyComponent();
}
}
im doing a sweepsinglebychannel on my character class
and the hitResult triggers the public function of Test_Implementation()
but only the client removes the cube
not the server
What am I doing wrong?
void AMovingPlatform::BeginPlay()
{
Super::BeginPlay();
if(GetWorld()->IsServer())
{
SetReplicates(true);
SetReplicateMovement(true);
}
}
please help
Again, are you RPCing to the server first on the character before calling Test()?
Can you give an example?
the character does not have a UFUNCTION(Server, Reliable)
only the AMovingPlatform has
You can't call UFUNCTION(Server) on actors that are not owned by the client. Those types of UFUNCTIONs are Client -> Server RPCs and they can only be executed on client owned actors.
You must use a UFUNCTION(Server) function on one of the client owned actors, like their character, player controller, or player state, then within that function you can execute what needs to happen on the server. And if you pass along a reference to the actor you're trying to interact with in that function, then the server can use that actor reference - you need to either cast or use an interface to perform the required function on the target actor.
Here's a BP example to show the flow.
TY!!!!!!!!!!!!!!!!!!
it works
when i placed the UFUNCTION(Server, Reliable) on the character
it worked
It's me again XD
I'm having this NetMulticast being called by the Server inside the character class.
UFUNCTION(NetMulticast, Reliable)
void NetMulticastDoFunction(class AMovingPlatform* thePlatform);
void NetMulticastDoFunction_Implementation(class AMovingPlatform* thePlatform);
void APuzzlePlatformsCharacter::NetMulticastDoFunction_Implementation(AMovingPlatform* thePlatform)
{
if(thePlatform)
{
thePlatform->Test();
}
}
The server simply calls this function but the clients dont run the Test() function
I don't think you need the class specifier. You're using a reference to an actor, not the class of the actor.
changed it, but still the same
basically the Test function is this:
void AMovingPlatform::Test()
{
UStaticMeshComponent* theComp = FindComponentByClass<UStaticMeshComponent>();
if(theComp)
{
if(newMesh)
{
theComp->SetStaticMesh(newMesh);
}
}
}
public:
UFUNCTION()
void Test();
UPROPERTY(EditAnywhere)
UStaticMesh* newMesh;
Hi veryone, I've been struggling to solve this problem. Please help me.
I have a multiplayer shooter game.
For now, When I left click, the character fire automatically. But the problem is. The line tracing and applying damage only happen on server then the visual effects are played on the client after some params are replicated.
But the problem is, there is a huge delay between the point I click a button and the player then fires.
I use Unreal Engine network simulation to get around 30-60ping.
How do I solve this problem?
it might be that the host is running in background, try using the UE Play as Listen Server
Thank you. But I intended for the host to be running in background. And I know that when I click a button, client has to send a request to server to trace a ray and apply damage etc. And then server replicates back to client to play visual effects. It takes ~1/10s to do so. So there is a delay.
I also tried to PIE with Listen Server, On client side, it's still delay
@past totem try to route peeps to #online-subsystems if it's about sessions and such
You predict the hit effects locally usually
Just not the damage
You don't want any delay, not even 60ms
Feels like crap for the local player otherwise
Thank you. I'll try. I use GAS and the visual effects are replicated using Gameplay cues
Yeah but shooting a gun uses a predicted GA
So the GC should also be predicted fwiw
That's a #gameplay-ability-system issue then
Cool. I'll try to do it first then I'll ask for help there if I can't
There are more people than can help you with the setup
Thank you
Theoretically if the ability is set to predict and is started locally on the owning client, the only thing you have to ensure is that the prediction window inside the ability graph doesn't "die"
Which usually happens if you have latent nodes
You can then use the WaitNetSync with ServerOnly Wait to give the Client a valid window again
You should also read through Traneks gas guide once more cause it talks about prediction there
Thank you. That's really help.
I'm reading it rightnow
Hey guys, I am unable to make the players shoot when I increase the number of players to 2. I am getting this error and I suspect something wrong with the way the shoot logic works
The logic under question is this
I'm guessing that you created your Rifle in client and trying to call a server RPC
this is the fps starter template
so all i did is increase the number of players to 2 and replicated the projectile and the character mesh
so i can see my guy running around but he can't shoot because of that error i mentioned
FPS starter template isn't MP ready AFAIK
No it isn't
The Shooter Game
Unreal has another template (or more of a demo) for multiplayer FPS
Lyra is the new kid on the block but it's a bit excessive/overwhelming to say the least
And it doesn't really teach you anything because JustUseGameplayAbilitiesForEverything(TM)
There's also the "Multiplayer Shootout" sample, but that's hidden somewhere deep on the launcher and hasn't been updated for some time (but it is BP, unlike the others)
How do you make a kill counter in a multiplayer game when people have lost of different blueprints?
Put it in the player controller?
I have a bunch of actors, that players can posses. Do I need to keep casting on DamageEvent? OR is there another way
Use a parent actor for all of them?
I'm using PaperZD so the parent is locked on that
I tried making a parent but I cant cast it to it, it keeps failing
I'm trying to get DamageCauser
For Servers + OnRepNotifies.
I understand that the "On Rep" notify only gets fired if a value changes and is then replicated down to clients.
But how do you handle scenarios where the game could be either a Listen Server or a Dedicated Server. If we take the following simple code;
void AWeapon::ServerFireWeapon()
{
Ammo--;
}
void AWeapon::OnRep_Ammo()
{
Controller->UpdateHUDAmmo(Ammo)
}
In a Dedicated Server, this works perfectly. But in a Listen Server, I need to call UpdateHUDAmmo on the server, otherwise the listen server local client wont know to update their own HUD (but the remote clients do).
Whats the "best practice" here to manage this generic scenario? Especially with larger functions where I dont want to duplicate 10 lines into two different functions.
Do/can/should I put OnRep_Ammo() as a manual call inside ServerFireWeapon(), so that it forces the listen server to run the same code as if it was only a client? Or do I split a third function like UpdateHUD() which both ServerFireWeapon() and OnRep_Ammo() both call?
Hey guys. I have problem with motion controller replication. I tried everything but nothing worked. What can I do? I'm stuck
Inside the ServerFireWeapon implementation you could probably just do:
if (!IsDedicatedServer())
{
OnRep_Ammo();
}
```the Dedicated server check I believe simply checks the net mode, so if it's a listen server or standalone it will fire but dedicated server will not fire it. And not relevant on a client since it's a server RPC I think?
Motion controllers don't have proper replication by default (assuming this is VR). You need to either use a plugin or implement it your self.
But honestly all it takes is sending a server RPC with location and rotation and then smoothing that out on the other clients. Assuming you don't care about cheaters.
Or if you have a character that can move around constantly you could probably also send the relative location to the character so it syncs up a little better in the end.
Whatβs the proper way of doing a RunOnOwningClient for a BP actor placed somewhere in the world? Letβs say something like a monster that I want to hide for 1 individual player.
set RPC as client and call from a server RPC
?
don't think thatll work (since no client owns that actor)
u want to have a run on owning client event on the player controller or whatever
that then hides the monster u want
or something like
I think that's how u need to do it
Depends on if the monster is client owned or not.
But it kind of depends on the use case anyway because it sounds like a state rather then a one time event.
Hey, what is the best way to sync two moving platforms between server and the clients?
I've tried using client movement and server clock for the movement, however, there are still some hitches between the server and the client
I hope you don't mind the ping but the link isn't working. I could find it via google nevertheless.
that was quick, nice. Thanks π
How do I check if the pawn my controller is controlling has taken damage?
Event AnyDamage does not fire from the controller
I'm trying to make is so that when the pawn's variable Health reaches 0, they respawn as another character
Better solution would be utilizing EventDispatcher
Do I place health in the controller or the actor?
Or let the Pawn just tell the Controller if you only need to tell that one Actor
Health is usually in the Character/Pawn.
Since I have multiple characters, which hold different health values how would I make it so that the controller can tell when that pawn has died
- EventDispatcher in the Pawn that the Controller listens to
or - Tell the Controller directly if only the Controller needs to know
With the event dispatcher since one is on th echaracter and the other is in the controller how would I link them?
No
There would only be one in the Character
EventDispatcher are like Newsletters. The Character/Pawn has it and can Broadcast. And whoever is listening to it will get the Message.
When I create i in the pawn I cannot reference it from the controller though
That allows you to not care who needs to know about the death, cause everyone who needs to can listen to the Dispatcher
Also called a Delegate in C++
You should be able to reference it though
If you have a proper reference of your Pawn, cast it to your custom class
Then you can bind to the EventDispatcher
If you only need to tell the Controller about the Death, you can also just call GetController in the Pawn/Character and call a function on it to respawn the Pawn
But that's only viable if the list of Actors you want to notify about the Death doesn't grow
If it does, then the EventDispatcher is the better/correct solution
you can bind it on OnPossess (for the server), and I think OnRep_Pawn for the client
at those functions you ensure the pawn is ready
(I mean OnPossess might be called on a nullptr pawn so just check that π )
Also OnRep_Pawn is c++ only
Hi, developing a multiplayer game using c++, how should I approach having two actors participate in the same animation (e.g a ROLE_AutonomousProxy drags a ROLE_SimulatedProxy).
My current direction is to have the player in his local unreal engine instance (local = ROLE_AutonomousProxy) have the enemy (local = ROLE_SimulatedProxy) attached to a socket that is involved in an animation - that socket represents the location for the enemy actor to be placed (more specificaly, its mesh).
Before I dive more to my own solution, does anyone knows of a best practice / or can direct to where and what to search for β€οΈ
I don't think you need a Socket
But the idea is probably correct
UE5 at least has this Motion Warping stuff for Montages, so you can always let it MotionWarp to the right location and then just attach with relative offset
A Socket might be cleaner but not if you need 60 different ones
GrabLocation1, GrabLocation2, GrabLocation3, etc... π
Awesome though it doesn't seem natural to do so, I am trying to achieve something that will not feel like a hack on unreal engine.
Stuff with relative offset or even updating the location of each actor on its own, gets even buggier when u take network delays under account.
But attaching to a socket vs attaching to the actor with a relative offset is the same
Just that it's not tied to a pre-created socket
Hmm Oh u mean like define the relative offset once
like a const
not like - update the relative offset every tick
so yeah by attaching it to a socket I hope unreal sees it as 1 actor
am I making any sense ?
Lets me rephrase what I am trying to achieve I think Cedric helped me understand what I want better
I would like to have a state where two online players are participating in the same animation - more technical,** combine them into one actor** so that when I change the location of that actor it changes in both clients
let me know if I am talking nonesense
I dont understand how do I get the dispatcher inside of my controller without casting to my pawn?
You do have to cast to your pawn
I get this is what I'm meant to do but I cant get the object
The object is "GetControllerPawn"
Casting is not evil like so many BP tutorials tell you
But ONLY after the Controller possessed
I tried that but it doesnt work
the idea to not have to cast to ur pawn is dumb imo, u will need it for many other things later too
You can't do this on BeginPlay
You have nothing connected to the object pin on the left of the cast either. So you're not casting anything.
Also that IsLocallyController -> SpawnPawn is wrong
Like really wrong
BeginPlay already calls on everyone who has an Instance of that Actor
So here Server and local Client
I know since idk what to put in it
There is no need to ServerRPC
Just block remote with SwitchHasAuthority
And for the Dispatcher, you will need to use an event like OnPossessed
During BeginPlay you have no valid Pawn
Everything before the cast works perfectly, it just spawns my actors in and puts the controllers onto them
Also - why isn't the GameMode handling this? Curious question btw.
Yeah, GameMode should probably handle this in HandleStartingNewPlayer or similar
In the video I watched he said not to put it in gamemode
All im trying to do is to check if the pawn dies
That is it
Gamemode > Controller in that case?
I told you multiple times now
Instead of repeating yourself, try to apply what we suggest
I really do appreciate your help but honestly its like ur speaking another language
You can get the Pawn with GetControlledPawn when the Controller Possessed the Pawn
I dont understand what ur asking me to do
The thing is
If that is too much for you, then stop doing Multiplayer.
Cause you are literally facing singleplayer and beginner problems
Multiplayer is a whole other level of complexity
yea
You basically ask us how to figure out a simple respawn issue while showing numerous problems with programming a game in general
Which we then have to additionally address
The stuff I told you, you can google for those terms
If the language is a problem
But again, if you don't know how to do the Respawn stuff, which is basically the same solution in Singleplayer, then I would suggest not starting with Multiplayer.
It's just a suggestion. I'm doing this whole UE stuff for a while. You are by far not the first one to try doing MP first, and it never works out.
I know it's not the answer you want to hear. No one wants to be told to not work on their project that they do really want to work on. But what Cedric is saying is the better route overall. To get a better foundation in UE overall. Then you can come back and tackle the multiplayer problem. Adding networking adds a bunch of extra complexity that is not immediately obvious.
You can even learn UE doing a super simple single-player wave shooter game if you so choose.
If you want to proof us wrong, take the terms of OnPossessed, GetControllerPawn, Cast, Bind, EventDispatcher etc. and try to figure it the rest out with google.
I more or less told you exactly what you need to code anyway.
Hey guys, I'm not sure why but this is always returning false when executed by the server
The 'get movement direction' macro shown on the screenshot
your theme is cringe
the server doesn't have camera data
instead of the camera data, get the control rotation from the controller
I bet you also use it okay
I'll try that, tysm!!!
Oh my bad..........
I'm already doing it
what is 'Vector Zero'?
have you heard of debugging?
if you debug, you will find out which part is wrong
Don't directly compare float values. Look for the IsNearlyZero method to compare it to 0.
yea maybe change the 0.0 to 0.001 or soemthing
sometimes that fixes it for me too
You can also just remove the float comparison in the != check altogether
it's a vector btw
Not sure why it's even there.
Nice to know about this
Read this dude on the forum saying that Vector Zero has the tolerance pin and it is better than leaving nothing on the vector pin
How can I fix the problem with the controls on the client server? https://cdn.discordapp.com/attachments/966517078834151484/1024338455884472421/312.mp4
oh, now I get what vector zero is
lol
never seen this node before, sounds so useless tho
define 'this problem'
your videos are 25 seconds long
And If I wanted I could list multiple problems
The problem is. There is no problem with the vehicle movements of the player in the server server, but I am experiencing flickering in the vehicle movements of the player in the client server.
the problem is that you are using chaos and chaos is shit
yes it can π
ue5 has deterministic physics.
Networked physics was supported via the so called physics prediction plugin, but it doesn't seem to work very well π
I'm not talking about the vector. I'm talking about the green float pin.
Saying not sure why that is there.
π
can't u just think of it more technically, so like, can't u just,
attach one of the players to the other? (and disable the attached player's collision)
yeah I tried to describe the idea more technically here
But when the player gets disconnected the weapons are still visible on the server
ME TOO
have you considered pawn EVENT END PLAY -> destroy weapons
It works when i click on it quite but not when i directly close the game
event end play?
Yeah
I did in game mode
I created a custom event and ran on the server. That event is destroying weapons
Ahh now i understand
game mode is server
but thanks actually, that just made me realize that my weapons were staying in game after a player was leaving.
What ?
I just mean that I realized I have the same issue in my project
You have the same problem too ?
Did you fix it ?
I will now
So i have to call the event an endplay in the character blueprint ?
yea it works I just did it
I just saw a project and they called in gamemode or player controller
best is to do it in the character
It doesn't work in game mode so maybe this will work π
Thing is, when I do that, because the player client sends the location of the player to the server it means:
- player1 grabs player2 on his client
(they are performing an animation togather where player1 drags player2, so their position also keeps updating controlled by player1) - player1 sends keeps updating the location of the now combined meshes of the two players, to the server for a period lets say 10 seconds
- the server sends the location of player1 to player2 which also performs the meshes attachment of player1 and player2
- the location keeps updating: player1->server->player2 for 10 sec
starting to write this I was skeptical but as I was approaching bullet 3 it all started to make sense
and it might work
have no time to waste man <#
β€οΈ
thats why i love to plan
Does this work waffle ?
Hmm im gonna give it a try soon and will report back
it will work for sure the thing is I am a bit concerned about network delay that's all.
thanks you guys I really appreciate the time you took to help me figure this one out
You had the same issue ?
well I'v read it, it sounds like it might work, or might have desync issues, but u will know once u try 
bro he is talking about something completely different
and I already told u how to fix ur issue, I just did it in my project and it works
spank u ^_^
Hi im trying to use a servertravel command, however it only works when the net mode is set to standalone. It doesn't work when I have net mode set to listen server
does anyone know why?
servertravel only works in standalone
according to google
"Hey I just tried this for the first time and it seems server travel does not work in all preview modes, but it does in standalone mode."
this is what I searched btw
well the problem is that im trying to get my product approved for the marketplace, however this is the point my product is failing on:
Which means the reviewer tried the product in editor.
well there must be a way to tell them that they are wrong
go to #fab
alright, thanks for your help
WORKS β€οΈ
looks good
lesson learned (
the millionth time, sometimes its faster to just check it out instead of speculating. am I right

nice make sure to test with network simulation enabled tho
i'm a noob, is that an option I can toggle on/off?
network simulation
how does this coexists with ROLE_SimulatedProxy ? does it affect it, I mean I know its smth other then authority but the fact that I have this means I am on simulated network because I can see / use simulated actors
do u mean network simulation as in physics simulation on the server or smth? sorry I'm kind of lost
it's in the project play in editor settings
editor preferences*
oh and it simulates lags and packets and stuff>>?
yes
like not on lanohhh
lan*
ohh
thanks man !!!
wow assuming u are a man is not nice so whatever u are u are awesome!
wow my game is shit on real network
gonna work on that
π okay sure yes I'm
probably like 99% of the people here are
imagine girls coding
π
haha
but yeah thats not a nice thing to say dude
and I know some real good female devs
yea just jokking
i know i know
thanks mate gonna report back with the results asap
can replicated variables be private? π€
Yes
Wouldn't make sense if you couldn't.
More of a PB&J kind of person myself
I had this lovely cheese and onion sandwich the other day.
I am willing to pay for multiplayer replication tutoring if there are any experts in here.
be more specific what u want to learn exactly and how much u want to pay and how many hours and in what format and then probably go to the #freelance-jobs channel
In my experience, the people who offer to pay for private tutoring can't actually afford an expert's price.
Sucks for you?
Not really. I'm not the one in need of private tutoring π. But #freelance-jobs is a more appropriate place to post for these kind of contracts.
I think it's so closely similar it is hardly even noticeable
So, doesn't matter
Final answer
I'm terrible at this it has to be as perfect as possible
I can't just choose a random one
You don't have to trust the coin.
but I'm not sure
Does anyone here offer tutoring services for multiplayer replication? I have stuttering issues on spell casts and movement. Instead of just fixing some issues for me I want someone well versed in the process to teach me along the way.
Again - #freelance-jobs
It doesn't work.
Or, you can just describe your problem here and people might be able to help
No, I explained what I wanted. You can ignore my posts as you are too arrogant to understand what I want and that /freelance is not working according to the instructions unless you know another way to post in freelance.
Yes it worked after the third time, thanks. You can see me posting /job freelance in general chat.
I'm pretty sure once it works we can't see it
What do you mean by that? It's already posted. You have such a shitty personality.
Posted well before you comment.
Dang - imagine trying to ascertain someone's entire personality based on like 3 statements.
No, the conversation continued in general chat.
And in private chat.
You're moving up there with him.
lmfao
I'm merely pointing out the fact that commands that work can't be seen by other people, so if u posted /job freelance and it worked, we can't see it
but there was only one line there
As an example of it not working.
yea and thats'; why we were able to see it
Then I apologize for that particular misunderstanding, I thought you were referencing my post in freelance jobs.
You refuse to answer a simple question. You do or you don't, whether you tutor me or not is a different question.
but how would I know if I would tutor you or not if I don't know what it's about
I couldn't answre
your question was too generic and this discussion is neither interesting, funny, or has any point

why's that ?
Ik it's neded for dedicated servers but if u r using listen servers maybe it's not needed?
So you can have a separate client and server target build.
I've read a lot of it, I have multiplayer running in my game, most things work, I have issues. Most resources seem to either bee to generic for my understanding or too specific to not relate to what I am doing. I can and will continue to push through this and learn, but I am asking if someone is willing to offer tutoring services to me.
What - the tutor request has absolutely nothing to do with server builds, lol
No, I am asking for a tutor too look into my examples and show me proper ways of doing things. I do not want a long term partner or employee.
No. You don't need a source build for listen server setups. That information being shared is just random information for no reason.

I have found 3 and have appointments. Those don't start until next week. I was looking for someone more readily available. Lots of people good at giving bad advice here, yourself included.
u guys just relax
I am merely defending my simple requests from snarky comments.
No, my questions was very specific and you answered a different question. You were more interested in giving a command than communicating.
you're right cuz I didn't want your dms and neither do I want this discussion
Yes, you do. That's you keep replying to my request even though you have no interest in actually tutoring.
nop
I posted in freelance jobs, and I did specify more in this channel.
So there's this really neat feature Discord has called "block user". Just saying.
I am not interested in solving the problems in this channel, I was interested in finding people wanting to tutor.
I heard if you use it properly, then you can totally get on with your day.
I always miss the fun conversations. π¦
What am I doing wrong? The NetMulticast doesn't work. The code is placed in the Character class and the function was called from the Server.
UFUNCTION(NetMulticast, Reliable)
void NetMulticastDoFunction(class AMovingPlatform* thePlatform);
void NetMulticastDoFunction_Implementation(class AMovingPlatform* thePlatform);
void APuzzlePlatformsCharacter::NetMulticastDoFunction_Implementation(AMovingPlatform* thePlatform)
{
if(thePlatform)
{
thePlatform->Test();
}
}
What do you mean "it doesn't work"? Are the actors you are expecting this to run on net relevant
Would definitely start with a UKismetSystemLibrary::PrintString(this, "NetMulticastDoFunction"); above the if statement.
basically I have a character class. If I click left mouse button it will tell the server to change the mesh of an actor that is linetraced (the changing mesh part is in the actor class) and it will call another NetMulticast function which is in the character class
the server function works, just the netmulticast doesnt work
server function is placed in the character class, the netmulticast is placed in the character class, but the change mesh is placed in the actor class
Start with a print. See if it prints anything using the Kismet print has the benefit of also showing which machine ran it.
server runs the change mesh function and the netmutlicast function
ok ill try
after 20min of compiling.
A text message was printed out to 1 of the client, not the host
You should be able to test this sort of basic thing in PIE. Also, you said something about this being for setting a mesh?
ill show you the code
I also tested this on host
when the client runs the code, the host changes the mesh, but the client doesnt
when the host runs the code, the client changes the mesh, but not the host
//I call this function from a Mouse button click
void APuzzlePlatformsCharacter::MyFunction()
{
//The client will call the function
if(GetWorld()->IsServer()){return;}
ServerCharacterFunction();
}
void APuzzlePlatformsCharacter::ServerCharacterFunction_Implementation()
{
FHitResult hitResult;
FCollisionShape sphere = FCollisionShape::MakeSphere(20.f);
FVector locationForward = GetActorLocation() + GetActorLocation().ForwardVector * 2000;
if(GetWorld()->SweepSingleByChannel(hitResult,
GetActorLocation(),
locationForward,
FQuat::Identity,
ECollisionChannel::ECC_Visibility,
sphere))
{
AMovingPlatform* theMovingPlatform = Cast<AMovingPlatform>(hitResult.GetActor());
if(theMovingPlatform)
{
theMovingPlatform->Test();
NetMulticastDoFunction_Implementation(theMovingPlatform);
}
}
}
void APuzzlePlatformsCharacter::NetMulticastDoFunction_Implementation(AMovingPlatform* thePlatform)
{
UKismetSystemLibrary::PrintString(this, "NetMulticastDoFunction");
if(thePlatform)
{
thePlatform->Test();
}
}
private:
void MyFunction();
UFUNCTION(Server, Reliable)
void ServerCharacterFunction();
void ServerCharacterFunction_Implementation();
UFUNCTION(NetMulticast, Reliable)
void NetMulticastDoFunction(class AMovingPlatform* thePlatform);
void NetMulticastDoFunction_Implementation(class AMovingPlatform* thePlatform);
that's on the Character Class
actually, when its 2 players , that's what happens
For starts. Probably nothing to do with this issue, but don't gate server like you're doing in your first function. If this is meant to be changed by player, it shouldn't matter whether a player or server calls this first function. Both of them can call the server function. Server simply calls it locally instead of networking it if they're a listenserver. Much less branching in your netcode.
What is Test doing?
i removed this
//The client will call the function
if(GetWorld()->IsServer()){return;}
and the host works totally fine now
when the host left clicks, it changes on all clients
but when the clients, it changes on the host only
You're calling Test twice on Server technically. Don't need to call that locally when you have the Multicast there.
sorry i was wrong
when the host calls the function
i mean when host left clicks, only the host changes the mesh
not the clients
and also when the clients do that too, only the host changes the mesh
Are your moving platforms replicated?
Should be valid on the client then. Bit odd.
On another note though. Are you planning on doing anything besides changing the mesh here?
Asking because your current task is better suited for an OnRep through replication rather than a multicast.
just change the mesh
what do you mean OnRep?
im doing this to learn netmulticast
π
maybe because its pointer ?
i mean
void APuzzlePlatformsCharacter::NetMulticastDoFunction_Implementation(AMovingPlatform* thePlatform)
{
UKismetSystemLibrary::PrintString(this, "NetMulticastDoFunction");
if(thePlatform)
{
thePlatform->Test();
}
}
the address is different for the host and for the client
right?
could be that I think
Multicasts are more for like, playing a quick emote that won't affect gameplay. Or broadcasting random things that don't need state. Your mesh needs state. It should definitely be a replicated asset pointer in the platform. ServerRPC should get the platform, and tell it to change the mesh pointer, then set it locally. Asset pointer can replicate to clients, and have an OnRep that locally changes the component's mesh to the new asset.
The pointer should be fine, that's why I asked if the platform was replicated. Pointers to assets, and pointers to replicated actors/actorcomponents/UObjects are net addressable. They get converted to a guid for sending, and then back to a pointer on the other side of the RPC.
this works on all client, including the host
UKismetSystemLibrary::PrintString(this, "NetMulticastDoFunction");
Does this mean that the NetMulticast works, just cant change the mesh?
or
Dunno without testing it. Either the pointer is invalid on the client, which isn't likely if it's a correctly replicated actor and the client can see it. Or whatever you're doing in test isn't correct.
- Multicast/Client RPCs VS OnReps (Towards stateful replication):
https://vorixo.github.io/devtricks/stateful-events-multiplayer/
recommended read for the use case
ok thanks
I've learnt something new, but still this isn't my case
my case is, they are all connected
once a player (after they are connected) left mouse button clicks, it should change the mesh for all
ok, when do i use netmulticast and when onrep?
can i use chat
onrep?
i mean simple chat system
You should have the answer if you just read what vori linked you π€·ββοΈ
I did
when a variable changes, it will replicate
even if someone joins later it will replicate
but instead of storing all the messages on a TArray
is it possible to do it with netmulticast?
I wouldn't use onrep for chat, just a multicast.. maybe even an unreliable one.
Do you need a chat history when a player joins late?
And if you do, probably better to do an rpc to that player of the last x chat messages or something, rather than constnatly replicating a tarray.
ty
Forget that, just replicate the server text file that you store all the chat in. Get years worth of chats when you join
Why did you ping me?
I'm not really in a position to check code at the moment
Ping me in like... 5 hours
Whats a good place to bind delegates for clients? PostInitializeComponents doesnt seem to fire on clients for server owned actors, which makes sense but is there a "proper" place/way to bind delegates?
Depends what you are trying to bind. Chances are the delegate you are binding is fired before that function is called
Its latent stuff like match state and what not, nothing immediate. Its on a rep notify so it will always fire for late clients
but that leads to the question, does begin play fire before any repnotifies are delivered to clients?
Are you binding the delegate in repnotify?
It's indeterminate
gotcha
I tried figuring out the order of networked called and.. Well I didn't get anywhere. I'd try and think of another solution if you are relying on this. Even if it's janky af, just get it working lmao
I sunk way too much time trying to do stuff the "right" way
yeah.. begin play seems to work fine for me so I suppose I will use that
post login might be a good entry point though
I couldn't figure out how to check if a client has a valid game state and other replicated stuff. Instead of checking it on tick, I overrode all the onrep functions I needed in c++ to set flags, then each time a flag is set I check if all flags are set and if so, I do a server RPC to say I'm ready. It's a stupid solution when I could have done a one liner on tick
Yeah that doesnt sound too bad
I mean i thought it was more elegant than tick because I wasn't doing useless checks in tick, but it was a dumb micro optimisation that didn't matter
its always a struggle to draw the line between good architecture and dumb micro optimizations haha
Comes with experience I guess
definitely
So I just implemented object pooling on a laser weapon that has client side prediction to reduce the feeling of input lag, but now the ownership is all screwed up because the server owns both server and client laser beams because they're pooled by the server instead of spawned by a player with a RPC. Not sure what I can do to resolve this other than abandon object pooling for the client. Any suggestions?
The laser beam does a line trace and may or may not continue on depending if it hits a mirror or not. It spawns in a laser beam actor with a mesh, does some distance calculation work then sets the rotation and scale. Only the server side laser beam is being used for gameplay related collision events, the client beam is just for looks.
I used to have it so the client laser beam was only visible to its owner but can't now because it isn't being spawned by the player anymore.
And I drew a diagram on your diagram with the solution, thank me later! : )
That just brings the network lag back. No thanks.
and im not going to use reliable on tick either
I don't think I can top off that response π€£ π€£
make it client side and don't have the server do any of that stuff
But its used for collisions to drive gameplay, it must be server side.
And to reduce the player's feeling of laser lag I use a second laser beam that's visible for them only.
The only thing that technically has to be replicated is the beam you want everyone to see . If you want a lag free experience let the client decide what it hits collision wise
I'm just not going to use object pooling for the client side beam. The server beams are pooling just fine now and the ms has been saved.
and then send that information to the server unreliably
if you're worried about hacks and what not then do as many light weight checks on the server as you can to verify what the client says makes sense
The hits are server side, and sfx/particles are multicasted
I'm just going to not use object pooling for the client beam
Those will be spawned and destroyed without replication and since they're a separate blueprint actor there's no gameplay logic happening if it collides.
yeah I'm not sure why you need actor pooling for a lazer anyway
don't people use particle effects with a line trace for that
because it spawns in more and more whenever it bounces off of a mirror
and runs on tick
that wouldn't pose any problems tbh
you should be more worried about fps rather then tick performance from the laser particles
That's why I added pooling
tick times were large when I had 4 other AI's using the laser, then with object pooling it went way down
Particles are only spawned in once on hit
The laser beam is a mesh
What exactly do you have on tick that could be so expensive for a laser?
aren't you just line tracing, or sphere tracing?
you should be able to have 10,000 lazers on tick
You can follow along if you'd wish: https://www.youtube.com/watch?v=EM1MkdDW0Ic
In this free step by step Unreal Engine 4 tutorial video (UE4 how to) you will learn how to make a laser system that reflects light with emitter, sensor and mirrors using blueprints.
All my UE4 tutorials: https://www.youtube.com/watch?v=BT0jFArPtGM&list=PLEp7216xGGILh3i2BZe2E0ZEuiIGa-VQT&index=1
Download Light Bulb asset: https://drive.google....
I mean you'd have 2 fps probably from the particles but tick wise wouldn't be a problem
let's see here
I used that as a starting point, and added a second (client only) laser.
I plan on adding particle effects during warmup, and cooldown and maybe some near the muzzle while the laser is on but not as the primary component.
I'm using the default template in UE4 and I'm getting some very slight rubber banding on my character class when I walk around with AddMovementInput. E.g., Client 1 watches client 2 move, when client 2 stops, client 1 sees them move forward a bit more and then correct back to actual position.
However, I don't see this behavior when I'm looking at the third person template. I have no idea why I see it in my project, but not others. I'm testing via 2 clients in editor.
Does anyone have any suggestions?
Are you using the CMC (Character Movement Component)?
Yep - it's just the base Character class - no additions to it other than movement input
Using default values for tick and network update frequency?
Yep!
Are you emulating lag?
Not intentionally - what's the setting for me to double check that?
search for "network" on the editor preferences
Network Emulation is disabled
there's only a small part under the heading Level Editor - Play for some Multiplayer options
If you play the game with p.netshowcorrections 1
Do you see lots of capsules?
Nope - don't see any capsules actually
so its not server corrections, its something else
If you make the character's capsule visible, and use p.netshowcorrections 0 does the capsule have the issue? or maybe its just the skeletal mesh and some animation causing the problem.
It's hard to tell... But I think no. The item that's rubber banding is a static mesh that is a child of the skeletal mesh (but the skeletal mesh is set to be None) Would that cause anything?
set to be none?
will there be a skeletal mesh in the future?
it seems like if all you're doing is adding a hat, then the hat should be a child component attached to your character
No, TLDR - this will be a VR game, but I need a PC character for easier testing
The hat is so I can visualize
So when you move the hat lags behind?
But what bone is the hat attached to if there's no skeleton?
More like when I stop the hat goes to far and then resets
No bone, just standard parent/child
Maybe it's easier to make a new Pawn and then add your Hat mesh and the CMC?
So there's no empty skeletal mesh
I'll give that a shot π
and capsule
oh I guess you can't add the CMC to a pawn without using c++
but then again why would anyone want to do that, when they could just use a character class....
@left lance what if you make the hat a child of the capsule and not the skeletal mesh?
It gets a better when attached directly to capsule, but still there a bit
alright sorry, I needed to finish up with my own work. that video took 50 minutes and I don't understand why
I went ahead and made a fully replicated laser beam that could bounce off mirrors like you wanted, and it uses minimal replication
The first laser is spawned by one replicated actor, after that all other lasers are calculated and created on their own by the client, so the server never has to send any information about it.
the only thing that get's replicated is when a lazer actually hits an object that should do something (which is checked by the server)
it only took about 10 mins to make, if what's in the video is what you were looking for then I can send you the code
you should be able to have as many mirrors as you want bouncing off of eachother without any problems
Oh cool, you didn't have to make anything lol. But also could you test with emulated network lag? Is there any noticeable lag when you enable / disable it? What about when moving around does it lag behind?
With clients having bad lag the end result of the lazer will always wind up being the same, but ofcourse will take longer to reach the end point
same with the box, the color might change slightly late, but it will always end up the same color
@graceful flame https://gyazo.com/fc16362ae64e2807dd432cc75b2a465e
oh that's close to what I've got going on here, but what I'm going for is more like the lightning gun from quake that also bounces off mirrors for bonus damage
So to reduce the client side feeling of lag due to the network having to replicate I make two beams, one is client only and doesn't replicate while the real server one has its mesh hidden for the owner.
But then with object pooling it stops working for the client beam because now the server owns them, so I just decided to spawn / destroy that one instead of pooling it.
the only lag you're really seeing here is client 2 waiting for client 1's rotation to be updated
you can't make that feel any better, unless you somehow could predict which way client 1 is going to rotate
Im curious to see what you've made though
sure, maybe it'll help
Can you share via https://blueprintue.com/ ? or was it c++?
@graceful flame
Character: (replicated, has beam component)
https://blueprintue.com/blueprint/3virh7_a/
Mirror: (not replicated, has beam component)
https://blueprintue.com/blueprint/7u3hos1q/
Replicated Box: (Replicated)
https://blueprintue.com/blueprint/x8en_hz3/
The lasers are instant and have no log in-between hitting the mirrors because they already exist and are ready to go. none of it requires replication
I don't think it can get any less lag free
because it's already completely client sided
I don't know my way around cascade particles, what does your particle system look like? The sharing website doesn't come with components.
I only know Niagara π
we are viral on reddit
https://www.reddit.com/r/unrealengine/comments/xpz028/ue_community_support_be_like/

, when a client pick weapon it will only show in server , not in client , can you plaease tell me where it should be a mistake , like in repNotify or ny other thing
Hey Guys. Are the replicated variables set in PlayerState going to persist across levels when using server travel with seamless travel enabled?
Si
So I can keep player specific data in it and it will be the same after the level changes, awesome. Ty
Hello everyone! Can anyone answer some of my questions about networking in private chat? (dedicated server, collaboration, hosting..)
Feel free to ask here
Alright then
For reference: the game we're thinking of making is an FPS Multiplayer, something like DayZ (dedicated servers, no matchmaking)
When working with a team, does everyone need to have the source engine built?
Not everyone needs a source build for that, you would probably desire to have a fallback listen server so that anyone can try multiplayer locally and quickly
As long as everyone understands what they're doing, you can develop with listen server in mind and dedicated is kind of a simplification of that
Then each week or so you could freezer multiplayer work, compile the dedi, debug and test that, and resume work
Hey all. I'm trying to implement a disconnect/reconnect system. I have based on WizardCell 's guide (https://wizardcell.com/unreal/persistent-data/) but I have some differences: in the game I'm working I do not want to destroy the Pawn on disconnect and re-instantiate it on reconnect.
I was able to override some methods in GameMode, PlayerController, and PlayerState, and it seems to work fine for the server; when a player reconnects, if they have an Inactive Player State, the game mode will get its pawn instead of spawning a new one. The server does indeed find the right pawn and associate it with the re-connecting player.
However, it seems like the reconnected player doesn't properly replicate. Actually I have this issue even when disconnecting
more details: I want something like a MOBA, where if a player disconnects we have an AI Controller possessing it.
That part is working, however there seems to be a mis-communication between server and client. The newly-spawned AI does properly possess the player, but when it does an action that should be replicated to the clients, it doesn't seem to work.
Also, when I join as a reconnecting player, in the server it looks fine but the new client doesn't see the pawn, as if it hasn't been properly replicated
has anyone struggled with that? What is the proper procedure for a disconnect/reconnect involving keeping the same Pawn?
thats my code for the action. I dpawning the SpawnCanicaClass from the client to check if the clients rotation was right
and it is, but once the server spawn it it does not
thats the correct code. Anyonw knows why this is happening?
I am trying to use custom data in player state (PS_Gameplay inheriting from PlayerState) for multiplayer. I have two variables (Color1 and Color2 used to set tint on mannequin) that are set as replicated, but they do not replicate as I expected or intended.
I have setup with listen serwer and two players, host and one client (two separate computers). I set colors in UI widget for current player only. I resolve player state by GetOwningPlayer->GetPlayerState, casting it to PS_Gameplay and SetColor1 or SetColor2. I have in UI list of players and their colors, retrieved directly from their player states.
When I am on host, change of color of host is visible to me (host) and client.
When I am on client, change of color of client is visible to me (client), but not visible to host.
Intended result is, obviously, that any player can change their own color and that change is visible to all players.
I can only conclude I still do not understand something about replication of properties. Only way I can think of is calling server via RPC and server in turn updating color in PlayerState, but... surely you can do that without RPCs?
I was doing something stupid, forgot to have the Player Controller Possess the pawn.
show ur bps/code bro
Only way I can think of is calling server via RPC and server in turn updating color in PlayerState, but... surely you can do that without RPCs?
it sounds like this is exactly what you are missing. no, it's not possible to send data from the client to the server without RPCs as far as I recall
that would explain it
so if I want to do on client something important then I always must do it via server?
well depends on what u mean in important but generally ye
thanks
I still have a huge issue with the disconnect/reconnect thing. When reconnecting the client gameplay abilities fail. Server keeps rejecting ClientActivation after the reconnection happens
might just be completely unrelated but do you destroysession before re-joining?
no. I'm using the disconnect and reconnect commands
ok Idk what u mean so I prob can't help
unreal has those exec commands that simulate a disconnection and a reconnection. If I disconnect the player and try to join the session in the "regular" way, it doesn't work (at least in OSS Null) because it says it already has a named session. But if I use reconnect then it works
can someone give me a hint how to replicate variables inside of local player subsystem
Have an Actor replicate them instead
You cant replicate ULocalPlayer
Or its subobjects
will it make a trick if i make abstract class of it?
Nothing to do with sbstract classes
k thanks
Teplicated variables font really belong in locsl player subsystem
That should definitely not be networked
i though i will record an array in game mode of assets currently in use and when i'm connecting to server i will sync array and load those assets
it should support preload as well
If its currently in use might as well ise hard refs
Preload is different matter
But anything doing sync load
async
Will flush your async loading
And at the moment of connecting, something will sync load something
Undoing your system in the process
damn, how can i bypass it π¦
i was planing to make TMap's like FString, SM inside of data asset that containts all assets data
and preload/load by key
Then you csn ptrload in lobby anf keep asset pointers hard refd
Sorry for the late reply. Will the listen server allow us to join from different networks? (Everyone from their home)
as soft references
It doesnt matter, as long as you can do NAT punchthrough
Dedi or listen
If you preload, you want to keep hard refs after
So they dont unload
mby gameinstance subsystem ?
does it work well ? cause last time i was looking on it and it was a little bit complex for me xD
thanks for hints, i will take a look on assets manager
Hi, when spawning an actor it doesn't show up on the client it only does for the server.
This is my spawn code:
void APlayerCharacter::SpawnEquippedWeapon_Implementation(UClass* Weapon)
{
if (EquippedWeapon) return;
if (!Weapon) return;
TSubclassOf<AActor> ActorClass = Weapon;
EquippedWeapon = GetWorld()->SpawnActor<ABaseGun>(ActorClass);
EquippedWeapon->SetOwner(this);
EquippedWeapon->AttachToComponent(SceneComponent, FAttachmentTransformRules::SnapToTargetNotIncludingScale);
}```
Make sure the actor is replicated.
In the constructor of the actor bReplicated is set to true
I am using a dedicated server and one client sees everything with a lot of lag and the other sees just fine. Why is this?
What's the difference between them? The laggy client and non laggy client both on lan or is one in China or what?
Both on my pc testing in editor
have you tested in editor with 'network emulation' on in the editor preference?
im trying to fire this sound and animation on clients, am i doing this correctly?
Im only trying to get the onrep event to do what it says in it, on clients
No, what is that
my advise is quit and become a photoshop artist
Hmm that does look fine
Is the component being properly replicated?
@signal lance why must the component be replicated?
wdym why ? do you want to ask the ue engineer that was responsible for designing the replication system? it's just how it is 
@past totem very funny dude
You have a replicated variable on the component, for it to do anything the component itself needs to have replication enabled
i just didnt comprehend it as the component needing replication
since it has an owner who is replicating
happy to entertain
@past totem stop, ty
ok so the owner replicating isnt enough
im gonna try to replicate the component aswell, sec
@signal lance thanks dude that seemed to do the trick, i thought i was going insane. Im sure I did read that if the owner of an actor is replicated you dont need to replicate it
but I might have misread that, need to double check what the rules are for this
says this in the documentation
Components replicate as part of their owning Actor.
Yeah basically all replication is handled through actors, when the actor replicates it also gathers replication data only from its replicated subobjects so keep that in mind
It won't replicate anything from a component if the component isn't set to replicate
I see
I also read this
Static components do not need to be made to replicate to exist on clients; they exist by default. It only needs to replicate when properties or events need to be automatically synchronized between server and client.
Dynamic components are components spawned on the server at runtime and whose creation and deletion replicate down to clients. They work very much in the same way Actors do. Unlike static components, dynamic components need to replicate to exist on all clients.
@signal lance appreciate the help, works fine now following those rules
Yeah static components are ones that are created together with the actor, either added in bps or in constructor
I don't have this event, we both use the same plugin?
Guys, how to replicate a variable to late joiner?
I don't have these parts
@oak prawn google advanced sessions plugin
if you have the link of this plugin can you send it to me π @past totem
I downloaded this plugin but I don't have it
looks correct
maybe u downloaded it wrong
maybe u put it in the wrong path
UR Project/Plugins/[these 2 folders]
there are other things join session create session etc but they are not the only ones
I assigned the events myself π
Just replicate it. They'll have it
Hey guys. Is there any resource whatsoever on the new Iris Replication system? From what I can see not even the source code has all the needed documentation at this point but I was wondering if I missed something.
Not yet, it's still in development
wait theres a new replication system?
Yeah it is announced in the ue5 roadmap although it is still super experimental. Supposedly it will be a lot better at handling more players per server instance among other things than the old one
π€
From the roadmap.
You can find some source code in the ue5-main branch under Engine/Source/Runtime/Experimental
Convenient for a certain game with lots of players I suppose π
I feel like I'm doing something wrong. There are a ton of UI actions I want to perform, as well as from other not 'owned' actors, so I have trouble with actually calling things on the server
I'm making passthrus on my controller just to call every function, like on the left
the right is about to get the same treatment, but hoping for better solution
Your inventory component should be using OnRep variables to replicate changes to your inventory. The OnReps can call an event dispatcher that your UI can bind to so it can update itself.
The component, if attached to a player owned replicated actor (like player controller, their controlled pawn, or playerstate) can then RPC to the server itself.
but, im calling these from ui/buttons
so its all calling from a client, which doesnt happen on server
Right, so your UI would need a reference to the player's inventory component, and call the necessary RPCs on the component.
thats what the call to remove is doing right now
and inv comp has comp replicates on
oh i bet its a function huh
it is! ill fix that
Hi, how do I get the local player num?
Without any input this works for the client player, but not for the listen server player, gives this error:
LogOnlineVoice: OSS: Invalid user specified in RegisterLocalTalker(1)
How can i manage 'local' variables when I have to use custom events instead of functions, without it getting messy. seperate graphs?
collapse nodes ?
and you can still use functions, but they have to be after the event
Just have the event call a func
Quite bizarre how the engine doesn't allow BP functions to be RPCs
ye lol
ok hopefully I found it
Datura, I made it a server RPC on the replicating component, and it doesn't fire after being called in UI
My theory on why they decided to do it that way is to ensure that someone doesn't try to have an RPC with a return value.
Events have to be void
ahh yeah for sure
Sure they could've parsed the function to make sure it didn't have a return value. But that may just be more work overall π
Getting any errors? Can you show how you're calling the RPC in your UI?
when checking on the server, what node to check if this player controller is the listen player that's hosting?
You can try these. May be a good idea to create a custom Actor macro or somethin.
If you are already on the server then the player controller at idx 0 will be yours (not always but should work unless u do splitscreen or smth). Unless you are running a player controller iterator which I am not sure if it is available in BPs but if it is and you are you should be able to just compare the local player controller with the iterator element
Is Server doesn't work for some reason, it's executing as true for the client (editor & packaged) oh nv u meant that for checking if it's a listen server
I will try the second solution thanks
works thanks
kinda no clue if what u meant wouldve worked, but is local player controller node worked, thanks tho
Listen server:
how can I execute only on the owning client from event tick?
so like I have something that I want to run only on the owning client and not the listen server
oh, has authority. right.
wait but has authority doesn't work if the owning client is the host
so I need something else
ok I figured it out
hi everyone, im trying to figure out why dropping my weapon with physics wont work. The physics works when i enable Start Simulate physics from the details panel. But not when i call this code.
well i disconnected mc_drop in the piture but i had it connected when i tried to do it lol, i just removed it to test some stuff
did u check that the actor is not null ? and that the multicast is executing on the client & server ?
Why not just do these things on the begin play of the item that is dropped?
also physics on MP shouldn't have collision unless you are gonna sync the server position to the client
Gameplay tags replicate in a it-just-works style, right?
true dat except if you start with the weapon itll fall out of my hands
welp did this, and it is returning null. guess i gotta rework some stuff
Add a boolean to your weapon, set it to "exposed on spawn" and "instance editable", name it something like "ItemInWorld". Refresh your spawn node, you'll now have that boolean available. Set it true.
In the begin play, do a branch based on that boolean, if true, run those commands.
Oh, and mark the boolean as replicated.
I will try that and give it a shot, thank you
Does anyone know if the Advanced Sessions Plugin can only be used with two people from the same country?
Hey there, how can I make actor/area appear blue or red depending on which team unit is on it?
Set color or material based on a repnotify of the team variable
Set team variable whenever someone enters or leaves
idk what repnotify of the team variable means, could you please link a tutorial of some sort that would send me in the right direction?
ha just noticed your name
@junior temple repnotify is the best.
https://docs.unrealengine.com/4.27/en-US/Resources/ContentExamples/Networking/1_4/
Thank you, yeah i just searched and found the same thing. Appreciate it
Wait so how does this help me? Whats a team variable and how do they go together? I still dont understand the basics of how this would setup
example talks about streetlight changing on delay
Part of my team is in a different country. We were able to test fine.
oh ok nice ty
@junior temple your team variable could be a bool, int, enum, or however you wish to represent which team something belongs to.
RepNotify is a method of replicating variables across a network, so that the client and server are synced with the same value as best as possible. You should read up on what replication is and how it works. I recommend searching for Cedric's UE networking compendium and reading that
bReplicateMovement showing error in actor
cedrcs compendium says you need to know c++, which I dont. Ill try to search the other stuff you talked about
I mean how do you even setup multiple teams to begin with before assigning variables and stuff
You can start out with making your first GameMode and GameState blueprints. Right click inside the content browser >>> Blueprints class >>> GameModeBase and again for GameStateBase.
The GameMode (server only) is where you can define the rules and win conditions of your game. You can think of GameModes like the differences between TDM, FFA, KoTH & CTF.
The GameState is where you can keep track of team scores and round timers...etc
So to answer your question how to setup multiple teams you can define some variables inside the GameMode blueprint to handle the data that makes up what a team is. Number of Players Team A, Number of Players team B. Then you can further define rules with simple booleans such as "ArePowerWeaponsAllowed?" that sort of thing.
Then later when you get around to making the various actors in your level they can reference data from the GameState and GameMode to alter their behaviour.
I think I understand, but so then how/why would you use gamemode and gamemodebase seperately? Also, how would a blueprint for the gamemode look like for lets say 2 player game like chess with spectator slots as well?
and would the gamemode blueprint be on client or server and how would you do that?
The GameModeBase is just what you select when you're making your own GameMode.
oh ok
GameMode lives only on the server, but the GameState lives on both sever and client.
so then I set gamemode blueprint when building a project with the server stuff and it automatically goes to server
or do i have to deploy a different thing on the server seperetaly
One of the steps is to separate your build into client and server targets, then only the server executable is uploaded to a dedicated server, and the client exe is uploaded to Epic or Steam or whatever.
so Im building two games basically with two different set of rules?
No
so its not two seperate projects?
There's only ever one real simulation and its on the server. Clients are just running their own simulations and replicated data flows down from the server to the client so that on their computer they see the other player characters moving around on their own.
ok so im not making two seperate projects then
correct
but using one project to upload something to a server
then giving the rest of the game to the client?
Before you compile your game you have to setup a separate server target if you plan on hosting with dedicated servers.
If you are using listen server then there's no need for separate server / client builds.
no i need a seperate dedicated situation
I have created a dedicated server game with aws but how can I create a new session or something after max player join is filled
and for testing ill prolly be using aws free version
I am doing the same
Server testing is probably one of the last steps though
Because you want a playable somewhat bug free game before you upload and start consuming AWS free tier credits.
Now I just need to know how i can create a new session after max player number is completed
yeah exactly, see im still lost at what i exactly upload to server, like how does the server get the game?
Have a read through that link I shared
Aws will give you virtual computer
you just edit like one file and then when you compile your game it separates them for you
You can run the server there and close the virtual pc
You have to put there ip address in your game
oh ok, I think im starting to get a bit of the picture here
Dedicated server setup is probably one of the last steps though, you can test your game with PIE for most client stuff, then standalone mode to test with Epic/Steam integration and hosting / joining sessions then finally a real server build and friends to test with for an alpha.
Do you know anything about this ?
No I haven't started with AWS dedicated server hosting with my game yet
I only know the main steps, not the fine details.
oh ok so whatever this setting is, it produces 2 versions for you?
one for the server and one for steam clients
Yea, the server runs a headless version of the game. Just a terminal, no graphics.
that makes sense
And since the server doesn't have any graphics to render it can run the game faster without having to require really fast specs. Servers can host multiple instances of the game at once so you can squeeze more out of them for a cost savings.
and unreal engine is doing all the work for you in producing this version?
But there's definitely a challenge in finding out what are the minimum required server specs for your game and that can change depending on how many instances per server you want to run
what do you mean instances? use chess with spectators as examples
Yes and no, you still have to think about your game in a multiplayer kind of way while the engine can just make it easy to compile a headless version for you to upload on a server.
I can't just use chess with spectators as an example because that's not a real game with a frame rate and blueprints ticking all over the place...lol
ah ok fair enough
but i mean by minimum specs do you mean how many games in one server?
But yea the most important thing to understand is that only the server is running the real game. All connecting clients are simulating a network lagged version of the game on their machines.
I mean the server specs, CPU & Ram
Since AWS has so many options you have to determine the best option yourself using your completed & compiled alpha version of your game. You ask some friends to join you in a session and see if the performance drops.
It might be more cost effective to choose AWS server option (a) and use 10 instances of your game with 10 players per instance or maybe its cheaper to use AWS server option (b) with 2 instances of your game with 10 players per instance and then spin up additional option b servers as needed.
That all depends on how demanding your game is for the server to handle without dropping below a playable performance level while under harsh testing conditions. (ex: 10 players all spamming projectiles at the same time, that sort of thing)
gotcha ok that makes sense, so if its a 2 player RTS game, itll occupy 2 slots per instance (or more if spectators) but the server will have to take the load of all the units, movements and stats?
The trick is to design your game in such a way that reduces the amount of work the server has to do while also ensuring that critical gameplay logic is handled only on the server so that cheaters can't run wild.
Same thing goes for the data that must traverse the network, you can use things like net cull distance, update frequency rates and relevancy to reduce the amount of data that flows between server and clients at any given moment.
Players on other sides of the level don't need to updating each other's data as frequently or at all until they are closer to each other. That sort of thing.
Meanwhile the server keeps track of where they are in the world at all times.
So for an RTS game if you have something like fog of war, then the client's don't need to be constantly updated for all units in the game, only the ones visible to them matter, but the server keeps track of all.
Replication is when data flows down from the server to the clients.
As for how you'd actually go about making that I can't really say because again I only know the main concepts, not the fine details.
ok
Have you made a single player game before?
I do environment art so i only know unreal engine single player capacity
okay, just keep in mind that with multiplayer there's also the netbroadcast tick time which eats into the frame budget and can grow rapidly if not kept in check
how do you keep that in check?
By reducing the amount of data traversing the network
oh ok
and by using setting lower update frequencies, using net cull distance, disabling tick, using relevancy
You can even do some funky stuff like bitwise operators so you can compress data over the network
ok so wait, would the logic for the server updating unit movements, be put in the gamemodebase blueprint?
compressing data doesn't affect directly the netbroadcast tick time. Skipping iteration does tho
dormancy ~
yea fair, it should save a bit on overall bandwidth though which adds up overtime
bandwidth is another story that can get mitigated with quantization, normalization and a side-step to server tick optimization
all your advices r coo regardless π
I haven't made an RTS game but I would probably use a player controller to issue pawn movements via RPCs
The gamemode would be where you define the win conditions. Maybe a boolean such as: AllBuildingsDestroyed? Then whenever a building is destroyed you check if it was the last one destroyed or not and if it was the last one you set AllBuildingsDestroyed? to true on the gamemode which maybe triggers an event on the game state to display a victory message widget on the winning player controller and losing widget on the loser's player controller.
ok so does the server side game automatically assign playercontrollers to clients when connecting and then just use the logic in the player controller or do we set that up?
and the cedrics compendium does have helpful explanations
Check out page 14 on the compendium for that
is it possible to test the Advanced Session plugin with 1 computer?
Event OnPostLogin
yea
How? I've set it all
Are you using standalone mode?
Two copies of the game running standalone mode, one hosts a listen server session and the other joins.
I'm using steams sub system
Exit the editor, right click the .uproject file and choose Launch Game, then do it again.
@graceful flameThanks for your thorough explanations and answering all questions, this has been quite helpful
Both use the same steam account though
that's okay
You can still test hosting and joining a session but not invites
You need two separate machines with two separate steam accounts for testing absolutely everything.
Its finding no sessions
Could be due to a lot of reasons
Might want to take your question over to #online-subsystems though
Ok will do, to clarify, using the same machine is not the problem, its my blueprints right?
Do you get the steam popup when you launch the game?
Yea I do
I followed this tutorial https://www.youtube.com/watch?v=_pPCS12aVtg&list=PLzykqv-wgIQXompUswD5iHllUHxGY7w0q&ab_channel=GameDevRaw
Become a member: https://www.youtube.com/channel/UCFjBMoGhlEum8jRgPvmWpJg/join
Join the {GDR}; Discord server and download my free project files: https://discord.gg/dUm3ZtYDuV
Buy me a coffee: https://ko-fi.com/bluntstuffy
Follow me on Twitter: https://twitter.com/BluntZombie
This tutorial is mostly about how to setup a multiplayer framework in...
Then just changed the nodes to the advanced nodes
along with other small things required to set up the plugin
I can find the session, I just cannot join it
Might be something in the log
Hello !
I have setup a multiplayer game, I'm trying to run this via pixel streaming
once I launch pixel streaming setup and try to connect via chrome ,for the first connection regular game flow works [host/join game via menu]
when I'm trying to connect via another chrome tab , I can see the game map directly,
every chrome tab session should be able to join the game as different player [this is happening when I create another instance of my game and try to connect via chrome],
my case is with 1 game instance 10 or more people joining via chrome need to act as players
can any of you confirm if this is possible, if yes any references would be helpful
I'm relatively sure that pixel streaming is just the hosted project being streamed like a video but interactive. If two Browser connect to the same instance it would show the same.
Guess you'd need a hosted game per player
Yep , when i launched second game.exe instance i was able to connect
If we go hosted game perplayer when no of players increase resources to replicate games would be huge so i thought
If via pixelstream can we avoid it
I have a (hopefully) basic question to ask. How do you track a player ID across a level load? Since my player controller is remade in the new level, the player ID is also recreated, and so I have no way of knowing who used to be who.
I'm not sure how you handle this on Null, probably from your own naming/login system or something maybe. But in Steam/Epic, you use their PlayerState's PlayerID
I'm not sure I understand the first half, but I am using the PlayerState->PlayerID var. This var changes when I load a new map though, and I don't know how to have that not happen.
Not testable in PIE. This value will be the same for the same player when using Steam or EOS
I wish I could say we are using EOS, but unfortunately we are not π¦
Do you know any workarounds or techniques I could use here?
Do you have C++ access?
Technically yes, but I am the only C++ dev on the team, so I just know pushing binaries will cause some issues with the others.
I'm not exactly against it, its just going to be a hassle I would rather avoid.
I don't think pixel streaming magically solves that the game has to exist once per player
I didn't know about that var, let me test it out. Do you know if it persists in a PIE environment?