#multiplayer
1 messages · Page 35 of 1
ah okay I thought its somewhere default in engine that I can just tick box and its replicated and I dont care more
You can tick ReplicatesMovement
But again, that will just set the transform to the latest one replicated
If the time between two updates is "high", it will teleport
And the local client pushing the box will also have to wait for the Server to tell it that it moved
Won't feel nice
For the Plane stuff, I'm not sure how one would do that. I assume a Character can be used.
I also saw a MovementComponent on the Marketplace that allows for more custom shapes and BP extensions
But that plugin is 300+€ iirc
(which is totally worth the price, cause coding that yourself takes weeks and months I would say)
So, after this talk I have started making the function how I'd actually want to do it. The issue came back, dunno why or what I am doing wrong.
https://blueprintue.com/blueprint/1ifoebvo/
(For anyone else reading this, issue is that when executed as ListenServer, the client with authority possesses their pawn, but can not move. The other clients can. Adding a default pawn to the gamemode does fix this, but I'd rather not)
If I spawn and posses right away, before doing anything else, it works. Exact same inputs.
But since I might set different pawns etc depending on what team u are assigned to, it would save me having to possess twice if I can find a solution to this.
Hi!
Hey Fellas, does anyone have any tips on how to debug for multiplayer code?
To be more specific I've been stuck on an issue that I don't quite understand with firing a weapon. I've used RPC calls, made sure the weapon was spawning correctly, and even logged it to see maybe I could find the issue there, which shows that its supposedly working correctly (that being: if has no Auth run ServerBeginFire method)... But the result is always the same, Server sees all clients actions besides for some reason client 3, and clients only see actions they perform themselves but don't see server's or any other client's actions.
Anyone know how I can debug this and get to the root of the problem?
Thanks for the help!
I'm testing a game with Unreal editor. I have two players, both running as Standalone. If I use OpenLevel with the parameter ?listen from one of them, am I creating a listen server or a dedicated server? I'm asking because the caption of window for the player still says "Standalone".
Thanks!
Your weapon is a separate actor?
correct
First you need to create a session
And set to replicate?
what is a session?
Clients need to join a session
do I do this inside the Character class?
Check this
#multiplayer message
I'll take it into account, but in the tutorial where I saw it, it didn't say anything about creating a session.
It is a listen server
Ahh my bad thought you were telling me to create the session... yes SetReplicates() is set to true on both the Character and the WeaponBase class
You are in C++?
yes
You can do it like this
bReplicates = true;
Try setting it to replicate on begin play
not on constructor?
Give it a try
SetReplicates(true);
Eh
and include this
#include "Net/UnrealNetwork.h"
This sounds a lot like you are performing a ServerRPC
And you don't have the Client actually own the Weapon
But maybe also replicates fwiw
Make sure you pass in a proper owner when spawning the Weapon on the Server
Yes, maybe you spawn the weapon on the client
so you can actually utilize RPCs that target or require owning clients.
I am, in the Character for the CurrentWeapon I am doing OnRepUsing to a method that sets the owning pawn and the instigator and all that good stuff
You do that when spawning
In the SpawnActor method
As Owner
And nothing else :D
that too
Cause all the other stuff doesn't matter for RPCs
The Owner has to be set on ServerSide when spawning the REPLICATED WeaponActor
Then you are good to use RPCs in it from ClientSide
Alright. Might be worth using the Controller of the Character for Owner instead
But it should chain upwards anyway when trying to check for the net connection
And you only call this server-side, right?
my bad XD one sec...
```c
Your Code
```
I would place the SpawnWeapon call into OnPossess or whatever that event was called.
That calls Server only anyway and guarantees that the Character has a proper Controller.
Then change the Owner to the Controller instead of this.
Not sure why you have ServerSpawnWeapon. That looks wrong.
Character CPP
void ABaseCharacter::BeginPlay()
{
Super::BeginPlay();
if(HasAuthority())
{
SpawnWeapon();
}
else
{
ServerSpawnWeapon();
}
}
void ABaseCharacter::SpawnWeapon()
{
// Set Spawn Params
FActorSpawnParameters SpawnParameters;
SpawnParameters.Instigator = this;
SpawnParameters.Owner = this;
SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
// Spawn Weapon Actor
CurrentWeapon = GetWorld()->SpawnActor<AWeaponBase>(WeaponClass, SpawnParameters);
OnRep_CurrentWeapon();
}
void ABaseCharacter::ServerSpawnWeapon_Implementation()
{
SpawnWeapon();
}
void ABaseCharacter::OnRep_CurrentWeapon()
{
CheckValid(CurrentWeapon, "Failed to Validate CurrentWeapon") // This is just a macro wrapper for null checks and log
CurrentWeapon->SetOwningPawn(this);
CurrentWeapon->AttachWeaponMeshToPawn();
}
void ABaseCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(ABaseCharacter, CurrentWeapon);
}
Character Header
UPROPERTY(Transient, ReplicatedUsing = OnRep_CurrentWeapon)
AWeaponBase* CurrentWeapon;
void SpawnWeapon();
UFUNCTION(NetMulticast, Reliable)
void ServerSpawnWeapon();
UFUNCTION() void OnRep_CurrentWeapon();
void ABaseCharacter::BeginPlay()
{
Super::BeginPlay();
if(HasAuthority())
{
SpawnWeapon();
}
else
{
ServerSpawnWeapon();
}
}
That's wrong
- The Server RPC won't call on BeginPlay, cause the Character is usually not possessed at that Point.
- Why even the RPC? The SpawnWeapon call limited to HasAuthority is totally enough.
Rest looks fine. One could argue that the SetOwningPawn is redundant if you make that variable replicated, but this works fine too.
Or rather if you just use Instigator for that, but w/e
I would swap BeginPlay for the OnPossessed event though
And drop the ServerRPC
PossessedBy might be the function
(name-wise)
So then I move the server RPC to OnPossesed?
No
You get rid of that thing
You only need
void ABaseCharacter::PossessedBy(AController* NewController)
{
Super::PossessedBy(NewController);
if (IsValid(NewController))
{
SpawnWeapon();
}
}
And change SpawnParameters.Owner = this; to SpawnParameters.Owner = GetController();
Also
Your ServerSpawnWeapon is a reliable Multicast
That is a thing that only the Server can call
Calling that outside of Authority makes even less sense
I see
And the function is mislabled cause of that, cause you would only prefix a ServerRPC with "Server". A NetMulticast would have "Multicast" in front of it
got it will do so from now on!
Im a rookie in multiplayer but heres what I managed to find... hope this might help
https://docs.unrealengine.com/5.0/en-US/travelling-in-multiplayer-in-unreal-engine/
Hi!
This the first time I try to develop multiplayer games.
Do you know any good resources which talk about what are sessions in Unreal?
I only find tutorials about how to implement them. I want to know which is a session, when to use, how it works...
I'm asking because I don't know if it is mandatory to have a Online Session System on all multiplayer's games.
I have found that there are different types of session systems:
- Online Subsystem Null.
- Steam
- Epic
But I don't understand the differences between them because I don't know what sessions are.
Thanks!
NULL = LAN, Steam = for Steam accounts, EOS = for Epic Games Store accounts
Short version
There'll be one too on PS4/5, etc
Do you know any good resources which talk about what are sessions in Unreal?
A Session is just connection information.
Sessions are literally just that - a way to say who's playing with who
(responding to the deleted message there)
They're handled by your platform
You then use the session to connect to a server
Is it mandatory to have a session in all multiplayer's games?
A session itself is just connection information. Meaning that it's what subsystems use to connect a user to a host. A host has to create a session and the subsystems handle passing that data to searching clients, who can use the session info to connect to the host who has created that session.
How it actually works to connect is largely irrelevant to most people who aren't working for Epic, Steam, Google, etc as from a game developer standpoint, it's largely platform agnostic. The subsystems and sessions are designed to not really care what platform they're being ran on so that it's easier to port a game from one platform or another with nearly no changes for the developers.
So, to answer the direct question, yes your host has to have a session, and clients will use that session info to connect to the host.
While not actually multiplayer relevant. Some platforms use sessions to track playtime as well, even offline. The new Lyra stuff for instance actually creates offline sessions to do their level opening for single player stuff like the little bomb game.
@kindred widget, thanks a lot
I do want to note that sessions are actually not needed for a host to host and a client to connect.
But if you don't have a session to communicate the information, you'll need the IP of the host and the host will need to open the server port.
(Port stuff is not 100% session related but part of what a subsystem provides you with called NAT punchthrough)
hello, i need a little help figuring out the process, i want a player to select a character while spectating, once they have selected a character they are now allowed to spawn, the game mode needs a way of getting the select character, i have unique keys so i just need to replicate this key somewhere from the client and validated it on the server. i assume I can't use the player controller between spectating and spawning, so where to store this key
maybe the player state?
A PlayerState is created for every player on a server (or in a standalone game). PlayerStates are replicated to all clients, and contain network game relevant information about the player, such as playername, score, etc. - ok so i don't want to do that,
Well, when the Player selects the Class you can RPC to the Server on the PlayerController and set the value there.
And when the Player wants to respawn you call "RestartPlayer" on the PlayerController.
Also on the Server.
And in the GameMode you can override GetDefaultPawnClassForPlayer (or something along that line), and cast the Controller that is the Input of that function to get the Class the player selected.
That's more or less the most Unreal Engine way of doing it.
oh i am mad, i thought there was a spectator player controller 🙂
You could also override restartplayer, which is the function that actaully spawns their pawn
first off i need to launch a player in spectator mode
how do i stop RestartPlayer being called in the game mode? is that called from the player controller?
https://docs.unrealengine.com/5.1/en-US/API/Runtime/Engine/GameFramework/APlayerController/ i don't see RestartPlayer, i see server and client methods,
i think i need to manipulate player state
Overwrite PlayerCanRestart and return false (in game mode)
how to get the character reference we just killed ? it's for a function purpose
btw is it useless to "Switch has authority" in the gamemode ? it should answer in the affirmative
i think an easier way is PlayerState->bOnlySpectator = true;
i see but the player has 2 lifes
so he can respawn if it is the first time he gets killed
yes. gamemode only exist at the server
So im having this problem where a UI is created and them I want to delete it after an event but no matter what I do it wont go away but it works on the server's screen would anyone know how to fix it?
I can smell a GetPlayerController(0) from one message away
To make it easier for us to help you, better for you to share code
sorry here you go
I did
?
This is not a node you want to use in MP, and looks like this code is being run on server
But considering the code is cropped I will keep guessing
Send full screenshot
Make it easier for us to help, not to keep guessing
So you are firing a server RPC just to fire a client RPC back
That's nonsensical
And I have no idea where that server RPC is called from
But anyways let me make the pipeline easier for you so you implement it yourself
Thats how I have done everything and it has been working perfecly
the accual event its self works fine the widget just wont go away
You want to remove a widget from player's screen? Widgets should be managed by HUD. HUD exists at the local controller level pretty much like Widgets do. If you're on server by the time that happens then all you need really is to either client RPC or waiit for an OnRep to be called then to access HUD then to access the widget and remove it
so have the RPC in the main player hud and call it from there?
If you're doing it on an event that is called on both server and client, like BeginPlay, then you want to use IsLocallyControlled to make sure you're at the local controller level
No, because HUD isn't replicated
So it won't fire RPCs
Great time to check multiplayer compendium in pinned messages
It will also tell you not to use GetPlayerXXX(0) nodes as they are not for multiplayer
There are always other ways to get what you want
For example you are in Character class and you want to get PlayerController? Use GetController
You are in Controller and want to get Character? Use GetControlledPawn
did you make the compendium your self?
I can tell that's the case by looking at the code and the issue you're having
No, Cedric did
I did another compendium that's not relevant to your issue
there one with your name and PFP on it
Correct, but I was referring to this one:#multiplayer message
It's also in pinned messages
oh ok
Also delays are not the magical solution to every problem. You shouldn't be using them on the regular if at all
im just using it so the widget goes away after a count down I had it use floats but I guess I changed it at some point
Read that compendium and what I said and reiterate when you're ready to go. The newer code will look 99% different
thank you
the OnRep functions can is inside a RPC?
They can be called manually wherever you want, but usually you do so when it's a cpp OnRep and you're on server, and you want the server to get the OnRep effect
Sure, that's why I'm calling it within an RPC (server). that's correct right?
There is nothing incorrect about it if that's what you need.
thank you for your answer
Is there a reason to why the server on the left sees the client on the right rotate however when the server rotates it does not show which is what I want to do the same with the the client.
How am I able to fix this?
how can i reconnect to my dedi when in standalone ? i thought itd be like open 127.0.0.1 but doesnt seem to work
Standalone testing mode or standalone netmode?
uhh, like in editor you select the dropdown from viewport into standalone game, with netmode client and it spawns a dedi aswell
It might not be running on the default port
There's a console command reconnect
ohh of course, im so dumb i've literally used this in other UE multi games before 
reconnect doesnt work if my client boots up first though 😦
How do I get a PlayerController to call a method on every machine's instance of the Controller's Character?
What event triggers the timeline?
i just got my first (successfully rigged) model to work in UE5. I want the game to be first person multiplayer but im wondering how I get the player to not see their player model and see other players models (and have the client player see their hands like how Apex Legends, CSGO, Team Fortress 2, and other games "overlay" the characters hands and weapons and hide their actual model [so when they look down there isn't feet])
Anyone have any advice, resources, or general ideas on how to do this?
Anyone knows how to make Actor do the networking via GameNetDriver + BeaconNetDriver exactly at the same time ?
how does ActorChannel is linked with Actor reference, I cant find where Channel sends the information to Actor ?
Hi Devs,
virtual void PostLogin(APlayerController* NewPlayer) override;
On LAN game PostLogin doesn't get called on hosted player ,any ideas how to solve this issue ? i want to get the Pawn of Hosted player
Server should call the multicast
is the anyway i can run the game as server with command line?
like for launching the game, I use
start "" "../UnrealEditor.exe" "../myproject.uproject" -log
how about if i want to run it as server (headless)?
did you try to use a batch file?
yup
looking at all .exe files, not sure what are UnrealMultiUserServer.exe and UnrealMultiUserSlateServer.exe
or UnrealTraceServer.exe?
or should i spend 2 hours building the engine from source with Deployment Server tag
MultiUser is probably that thing where multiple people can work in the same project live or so
But exe files aren't bat files
yeah, i'm making the bat file by addressing the .exe file and .uproject
-server -game should start a headless editor based server
nice thanks 🙏🏽
I found something cool
How does ROLLBACK NETCODE work, and why is it so difficult to program? A whirlwind tour of different solutions #pixelart #gamedev
The setup: you have a video game with couch co-op (pictured) and want to add online multiplayer. Easy, right...?
(thread)
13275
3741
super nice explanation, very clear
Yeah we don't have that in UE
Partially cause we don't have P2P connections
But it's probably still good to learn about it
yeah, and to be honest it's very difficult to do rollback without a fixed timestep, otherwise ticks are not guaranteed (and won't be) to be the same
so resimulating can be super tricky
You can do rollback code, you just have to be smart about it and expect differences. For example for movement, rollback to the server state and replay your moves, compute the new expected transform, and then don't apply the reconstructed state but compute the delta between where you were and where you should have been. Simply apply that delta smoothly on tick over a period that would be, say, half the average server update period.
Isn't that dragon ball z game in UE?
I assume they implemented it if it's such a standard for those 2D/2.5D fighting games
You can also separate your actual "simulation" too for fixed times
Yeah, kind of like GlassBeaver was doing
(but he doesn't do rollback)
Deserts of Kharak showcased something similar in a talk too, for similar reasons (RTS)
yeah
Basically anything that needs lockstep
pretty much
FrostGiant are doing the same
but they are going for rollback I think, which would be a first in RTS
to be honest, I imagine most lockstep engines are the same. It's practically imposible to make a compltely deterministic engine I imagine
way too many variables
Idk, the old ones might be not super detached
Dunno how Spring does it
Hi!
Do you know a good tutorial about how to work with sessions (OnlineSubsystemNull) with C++?
Thanks!
Check out AdvancedSession plugin, it's for Blueprint but you can simply make the same calls
Spelunky 2 has a rollback implementation AFAIK, very interesting to see how they managed to handle the physics and such so well over the network
A bit of a shame that not many people seem to be playing the multiplayer as it clearly took a lot of work to achieve
Hi. How can I do Set Velocity on a character with multicast? It seems to only be setting on client only, and won't allow to be set when triggered from server or multicast.
i've managed to spawn in to the world in spectator mode, now i want to spawn a playable character, so i've called PlayerState->SetIsSpectator(false); on the player controller, but i think i need to call something else to get the game mode to take over
which kind of game is it?
Sorry, but I need something better. I want to implement all Session stuff on my own with C++.
Check #online-subsystems pinned messages
You don't multicast, just set speed on server and on client (autonomous proxy)
It depends really on how you implemented your spectating system, but might want to check: https://wizardcell.com/unreal/spectating-system/
ohh that web seems nice, I wonder who will have written it xD
Yeah they must have put some ridiculous time making/writing it 😄
yeah sounds like it 😂
Thank you for replying. We already tried that as well, but without luck though. We get the correct values on a printstring, but it's like the SetVelocity node is being completely ignored.
Not that I've seen that node before, I was referring to SetMaxWalkSpeed
I meant this:
I can set it perfectly in any custom event or where ever, but not in server or multicast events.
You can however apply a force or or an impulse to the character in a certain direction to have them move.
Hello ) Im not sure if its right topic but have question
Im looking for some software that can emulate high ping
like i want to test my game at ping 50 and 100 for example
In the editor preference, you can enable network emulation
Thanks !
Or in the DefaultEngine.ini file
[PacketSimulationSettings]
PktLag=0
PktLagVariance=0
PktLoss=0
PktOrder=0
PktDup=0
Or even using negative numbers to travel in time
That's why they failed. They didn't have that ini file.
Hi All, Been investigating Dedicated Servers lately and think that I recall somewhere that Unreal Dedicated Servers can be connected in a cluster to allow for ultra high user scaling. Does anyone have any information on this that might be helpful? Thanks
#prediction
Advanced Sessions literally is pure C++
Get it, cut whatever you don't need if it makes you feel nice
Just don't expect a tutorial on how to create that plugin again
Hi guys, as I know level streaming doesn't work with multiplayer, what about new HLODs?
Level streaming does work in MP, it's just that the server loads sublevels for everyone
ye, so lest say I wanna make 2km*2km level for MP I have to make it single level with proprietary culling systems, right?
so server will hold loaded base level and spawn/despawn actors depending on clients location
Right, which World Partition already does
doesn't it require changing source code?
It doesn't for players that are not listen-servers. It just that listen-server player will load all tiles
So if you want listen-server not to, then yes you want to mess with the source code
okay, thank you 
What is the difference between distance-based grid spatialization with the replication graph and the basic actor net relevancy?
Aren't they both about not replicating actors that are too far from the player?
Hi, This is probably a silly question I have just started to dip my toes in Multiplayer, When you launch say 3 Standalones and use Create Session nodes in one of them, Should that session be visible to all others if they use Find Session Nodes from inside a standalone game ?
So Player 1 hosts the Game and then Player 2/3 join the session from a standalone game to enter into a multiplayer scenario?
With nothing else I think that should work for LAN SESSIONS.
over the internet you'll want some sort of subsystem
Yes I read that if i want Internet play i need to use a Subsystem like Steam, Epic etc.
but i cant see why i get 0 results from a hosted game from this code?
Player 1 enters the lobby map fine as if to say "Hi im waiting for moer players"
but the player 2 cant find the session
I just realised the Find Sessions Node says "0 sessions found" coming off the OnFailure (Will OnFailure) fail if theres 0 sessions?
Heyo! Hope y'all are doing well. I've got a super dumb question. Do Actor Components get replicated if they are spawned at runtime?
Documentation hints that yes they can be but after 8 hours I haven't gotten it to work once
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Actors/Components/
Here is my relevant code:
Then on play I get the Server print, but I am also expecting a "Client: IsmComponentMain_0" that doesn't show up. I am running a 2 person listen server.
What's the replicated yaw value used by the animation blueprint on a skeletal mesh in the Character class? The values I keep using are always slightly delayed compared to the visual rotation of the skeletal mesh, I have tried:
Character->GetControlRotation()
Character->GetBaseAimRotation()
Character->GetViewRotation()
Character->GetActorRotation()
Character->GetReplicatedMovement().Rotation
GetControlRotation, GetViewRotation, & GetActorRotation are accurate for the host, but none of them are accurate for the client. GetControlRotation for example doesn't work at all for the client.
To give some more context, I'm creating a turn in place animation where the leg rotation is effectively cancelled out but the upper body continues to rotate, so I need the exact value that is used by the skeletal mesh, otherwise the feet are constantly lagging behind a few frames.
Okay solved, Character->GetMesh()->GetComponentRotation()
Guess it makes sense to get the skeletal mesh component rotation directly
@young sphinx This is wrong in 5.1
there are a couple of CVARs you can activate to enable experimental server streaming in world partition
Take a look at WorldPartition.cpp and WorldPartitionStreamingPolicy.cpp
In fact the server streaming setup works for both, listen and dedicated servers
However have in mind its experimental, so there might be vulnerabilities (I'm 100% sure there's one)
Yeah I forgot to mention that article (and tbh it's clear) that it was written way before 5.1 was a thing, so I counted on them to check the latest released code (considering they are going to mess with it) how it behaves 😄
that's a nice to not admit you're were wrong (jk)
I can always be, and I'm really down for peeps to correct me, at least that's how I learn 😄
But I vaguely remembered it was fixed in 5.1: #multiplayer message
But I didn't have time to edit/add to that message
oh look its me
Soon I won't have time to show in the discord 
hello mum im on the tv!
Nah it's okay, you are answering loads of questions all the time... you might have missed it, its okay. But understand that if I read some outdated info I will have ti address it hahaha
Nah #multiplayer is fine, it has got its 💪 🧠 people
Laura, dont kill us
#multiplayer sucks
eXi thanks for saying the thing I wanted to say for long
You're known as a killer in your free time (a bug killer)
s/he -> they
lmao, evil Laura
I mean, I had to ban someone who was repeatedly calling us all lazy for not answering literally all questions.
I saw that 🙋♂️ , and you handled it pretty intelligently. Respect!
But again was it worth to get blocked for being helpful? 
My vacation ends on Monday and I have to get back into competitive multiplayer coding.
I think somewhere along the way my joy for mp died.
Oh no, we are #lounge ing again #multiplayer !!
We are protected by eXi, it's fine
shush
😅
Right, where was I
right banning Wizard I think
/strike Laura Offtopic in multiplayer
hahahaha
Obviously the reason being: "Too helpful for mp peeps"
it would seem that we spread lounge across all programming channels
It just the idle time until the next question
guys how do I multiplayer
GetAllActorsOfClass<AShard>
We are not, we are just #cpp 2
IDE wars wen
I'm sorry for not drawing you a freaking node
Denied cause entitled moderator
Ah, #gameplay-ability-system is unread. BRB
Soon I will get over that one, so it'll stay unread forever 
you just said you will not pass by very often Wiz
Hmm odd, shift+esc is just ~ for me
I think I'm too not discord to understand
Ah maybe because I'm on a 60% keyboard?
I want one of those for traveling
wait, your keyboard is a progress bar?
Ok I'm sure that feature is useless, so I don't care
mine is 100% and very heavy
has always been
good night ~
But it's bad when I want the F1-9 keys, or even a key like the End key, I just hate having to press two keys for pressing one 
yeah
Yeah it's gone wild
just bought new ram btw
couldn't resist the sales
I adore black fridays tbh, but they make me bankrupt
we should make raids to other channels
I actually bought a shit ton of stuff
How can it be that for like 20+ minutes, no one had an actual multiplayer problem/question
How about #cpp ? now that I was flamed by @whole grove
Can we archive already?
See, that's why this channel is dead. Definitely MP is too easy for peeps to ask anymore questions.
For the poor souls who think web is a platform to dev on
Yeah #blueprint is the hit now 😭
for some reason, every time I think about Unreal HTML5, I just imagine a toy car getting run over by a tank.
we should raid other channels, that are less used, to revitalize them. Maybe we get banned btw
yeah it was a mess few minutes ago lol
If #blueprint peeps did no #multiplayer , then the latter would have been archived since long
when have blueprints not been a mess
Imagine actually going into channels with questions and answering them
You can literally find all types of questions there
I have not noticed
That's you ofc lol
The trick is to make everyone believe that you are so busy that you can't answer atm.
i wish i would get paid for helping people
Well let's limit it to answering questions on discord for free
You do, you don't know I'm billionaire bankrupt by now?
Just do tutoring. Actually the more fun part of my job. And peeps are super thankful (even though you are getting paid and it would be weird if you then don't actually help...)
That's part of the long-term plan, wizardcell.com should be updated at some point 🙏
it should have ads at every corner of it
@whole grove how are you so consistly active btw? dont you like sleep or something?
She must have got some dragonHell powers, I'm sure
I would love for Discord to show timezones on profiles
Why the f do I get pinged in #umg...
She is dragonHelllllll 🐲
it's really nice when there is a mentor/tutor relationship, with less experienced devs or coworkers etc, and there is willingness from both sides to learn and teach
There are also a lot of peeps that have a hard time learning on their own.
Especially with how shitty tutorials and docs are for UE.
they wanna make a multiplayer widget and read your name on some paper on the internet or smth
yeah understandable
Some of them struggle for weeks and have everything cleared up after a single hour of personal help.
New channel to move to considering #multiplayer is dead? 👀
the learning curve is just too steep at the start but it does get easier to learn stuff as you go (at least that how i felt about it)
Yeah. To learn any complex skill, an experienced guide makes it so much faster. But what happens in programming is crazy, never saw any field with such knowledge exchange
Even if docs would be good and tuts would be better, some peeps just can't learn with that. They need someone they can bombard with questions. And they need handholding at the start.
I usually let the person choose how the session will be.
I'm not sure how much demand there is for tutors tbh. We are only advertising it as one of many things. But I could imagine that there are a lot of peeps who would pay for a few hours to learn.
I mean I know that I will get a teacher for Japanese once I learned the damn signs.
Sadly one of those things that depends a lot on the individual. If you literally have no idea about what you want to learn, then yes, it's a really steep curve.
You need to learn the Editor, the Coding Language, the Framework, the Bugs...
And each person learns very differently and in different ways
i learned english by just talking with people. i sucked and looked stupid at first but i got better over time
the key to learn something is to not worry about making yourself look stupid
Yeah doing that. Signs just take a while. I've been through the Hiragana ones and currently learn the Katakana ones.
Yeah, but learning English vs Japanese, depending on your native language, is a huge diff
Yes.
shi, tsu, n and so.. I think.
something something
MY GOODNESS
It's not like they could have chosen signs that are easier to tell apart
eoaöüö
Like that

🈲 ㊙️ ㊗️ (it means you're free to ask)
My wife is currently learning Korean
Started taking lessons last week
What I saw there made me like Japanese again
Someone new is typing. Finally a question?
I scared them away
Don't you dare letting us down with just engaging the already offtopic discussion
I can tell if that is a question, it has to do something with movement
Is there someone that actually knows how to use FCharacterNetworkMoveData?
I have no clue how to use it correctly and the documentation is not helpful at all.
Ok I was right, glad I could have dragonHell powers
Cedric it must be you, I'm too CMCless to answer it 
I think you are mixing the MoveData and the Compressed Flags
The Flags are the older system basically. Where you had 4 or so custom flags
Let me have a quick look at the CMC
Yeah so
The CMC has two modes atm iirc
With and without the packed data
Without the packed data it would just send the MoveFlags along
With the PackedData they are send via void UCharacterMovementComponent::ServerMovePacked_ServerReceive(const FCharacterServerMovePackedBits& PackedBits)
Where it ultimately calls
void UCharacterMovementComponent::ServerMove_HandleMoveData(const FCharacterNetworkMoveDataContainer& MoveDataContainer)
And then void UCharacterMovementComponent::ServerMove_PerformMovement(const FCharacterNetworkMoveData& MoveData)
Pulling out the flags const uint8 ClientMoveFlags = MoveData.CompressedMoveFlags;
After that it just calls MoveAutonomous again like usual
/**
* Handle movement data after it's unpacked from the ServerMovePacked_ServerReceive() call.
* Default implementation passes through to ServerMove_PerformMovement(), which may be called twice in the case of a "dual move", and one additional time for an "old important move".
*/
virtual void ServerMove_HandleMoveData(const FCharacterNetworkMoveDataContainer& MoveDataContainer);
If you have custom Move data, you usually override this function
or wait, one sec before i mix that up
Yeah, that's called right after the struct got serialized
Here you should be able to set whatever values you need
You can also override the PerformMovement one
Depends on what you want to do
Means you can do what yo uare doing in your UpdateFromCompressedFlags
In that HandleMoveData function instead
At least the MoveData-> parts
Preferably before calling Super :P
Means I would need to override "ServerMovePacked_ServerReceive" and "ServerMove_HandleMoveData" as well, if I understand it correctly?
They really should update the documentation. Those functions aren't even mentioned in that small footnote, where they mention FNetworkMoveData
It think this only really became a thing close the end of UE4
And kinda without really announcing it
You don't need to override Receive
Unless you need to
Yeah I think it was like 4.26
Just giving you options
For your specific code you posted
I would probably do HandleMoveData
Perform your WallRunKeyDown = MoveData stuff
And call super
Thanks! I'll write that all down, so I won't forget it 🙂
There is also MoveData the other way round
For the Client Corrections/Adjustments
There should be similar functions then
The sad part here is that there are functions that would need to be overridden that are a bit big
Eh here is the client version:
/**
* On the client, handles the move response from the server after it has been received and unpacked in MoveResponsePacked_ClientReceive.
* Based on the data in the response, dispatches a call to ClientAckGoodMove_Implementation if there was no error from the server.
* Otherwise dispatches a call to one of ClientAdjustRootMotionSourcePosition_Implementation, ClientAdjustRootMotionPosition_Implementation,
* or ClientAdjustPosition_Implementation depending on the payload.
*/
virtual void ClientHandleMoveResponse(const FCharacterMoveResponseDataContainer& MoveResponse);
If you have those keys pressed booleans
You kinda also need bool UCharacterMovementComponent::ClientUpdatePositionAfterServerUpdate()
But that's a bit of a shit show
Somewhere in the middle it does this:
// Save important values that might get affected by the replay.
const float SavedAnalogInputModifier = AnalogInputModifier;
const FRootMotionMovementParams BackupRootMotionParams = RootMotionParams; // For animation root motion
const FRootMotionSourceGroup BackupRootMotion = CurrentRootMotion;
const bool bRealJump = CharacterOwner->bPressedJump;
const bool bRealCrouch = bWantsToCrouch;
const bool bRealForceMaxAccel = bForceMaxAccel;
CharacterOwner->bClientWasFalling = (MovementMode == MOVE_Falling);
CharacterOwner->bClientUpdating = true;
bForceNextFloorCheck = true;
// Replay moves that have not yet been acked.
UE_LOG(LogNetPlayerMovement, Verbose, TEXT("ClientUpdatePositionAfterServerUpdate Replaying %d Moves, starting at Timestamp %f"), ClientData->SavedMoves.Num(), ClientData->SavedMoves[0]->TimeStamp);
for (int32 i=0; i<ClientData->SavedMoves.Num(); i++)
{
FSavedMove_Character* const CurrentMove = ClientData->SavedMoves[i].Get();
checkSlow(CurrentMove != nullptr);
CurrentMove->PrepMoveFor(CharacterOwner);
Cause it could be that the last SavedMove that it replays ends in the key being released
So it saves that the key was pressed at the moment
You could theoretically do this like this I guess:
bool UYourCMC::ClientUpdatePositionAfterServerUpdate()
{
// Save State
const bool bReturn = Super::ClientUpdatePositionAfterServerUpdate();
// Restore State
return bReturn;
}
But yeah, that's just a side note I guess...
Thanks for coming to my ted talk
I'll be off now cause it's freaking 2 am
I need those Ted talks to keep going 😄
Man thanks! Btw yeah It's 2am here as well. I actually wanted to stop 3 hours ago 💀
Do it. Future you will be thankful.
Also, what a simple question. Way too boring. Hope you peeps get more complex ones soon.

Wait till Iris questions start coming our way
Already handled ditched a few of them
I should look into iris, but I'm way too lazy for that. Also, it's way too new to be used in any kind of productive projects.
Yeah, I got really burnt-out trying to get it work, and trying to understand it without it working is meaningless to me, so to keep away atm is key tbh
The bar of questions has been raised quite high that I should consider moving to #lounge #bed
testing if something is deterministic is not easy as well, specially if not isolated. You first need a scenario which is repeatable, send inputs to the system, and verify outputs
Iirc some RTS did a double simulation of each frame on debug mode, so that any non-deterministic frame got caught in the spot
Btw I'm kind of amazed that the chaos wheeled movement component works perfect in clean and sterile multiplayer environment.
Didn't try with adding articial pings though, because I'm lazy
I probably shouldn't look at the code though, if I were trying to extend it for hover crafts and to get it working replicated. 😅
I got clearly weaker after that vori comment, you are #MP's only savior now
Always have been
I have not tried it yet. I only read random peeps stating it's all cool and supported, but that's about it
Someone probably has to properly test it
Well fwiw UE does go more and more multithreadded
I think even the CMC has async code now
But I'm too scared to look at it
well since you all seem like you are bored, can someone give me some pointers on how to implement my multiplayer system.
i want to have Player A host a game, when they load on to the map, either the map, the gamemode/gamestate, or them, not sure which does it, spawns like a bunch of items that will be hidden out of view, that every player(A,B,C,etc.) that joins, will pull instances from to build things. each player will have their own sort of blueprint for building things.
i read over the pinned guide and it was pretty helpful, and i got something working but not really. i implemented the spawning system on an event begin play in the gamestate, and as of now just a simple overlap box in a blueprint that when the player runs over it pulls the building blueprint from the player character passes it to the gamestate to build the the blueprint and then adds it to the overlap box blueprint in a certain spot. this works and doesnt work. and this is currently all in blueprint. if i need to use c++ i will attempt to learn it if needed. any guidance is much appreciated.
edit:
about to go to sleep but wanted to get this posted so that i could have something to go on in the morning, thanks again
@pallid mesa Legit thanks for the couple guides you wrote, they helped me figure out the last couple issues I had with using FastArrays for networking.
Hi! i'm using Advanced sessions for networking, but i'm thinking on upload the game to EpicGames so people can try it. Does anyone know of a easy solution like advanced sessions that works well with epic?
With steam i need to register and use a good idea, the 480 that steam provides for testing is useless even within the same country.
In this tutorial, https://unreal.gg-labs.com/wiki-archives/networking/how-to-use-sessions-in-c++, the author says that I have to change #include "EngineMinimal.h" to #include "Engine.h" without giving any arguments. Do I really to change it to us the OnlineSubsystem?
In other tutorials, the authors don't say anything about change it.
Thanks!
thanks I'll check it 
That is honestly quite involved and I'm not sure I don't actually understand what you want to create yet :<
(+ I think you posted when all the bored people where already sleeping again)
I'm relatively sure I didn't touch that in my version
This post shall give you a short introduction to handling your Multiplayer Sessions via your own C++ code. Most of you probably either started with...
Try that, see if it helps you more
Can you upload to Epic Games?
Like
Isn't that still locked off mostly and requires going through some application process with Epic?
Either way, #epic-online-services is probably also a good place to ask
Redpoint, or whatever the studio is called, has some free (no support in free version iirc) plugin
This is why I’ve asked because you didn’t touch it in your version.
Thanks
Thanks. Is it public so I can override and expose it?
I tried that too, but didn't work either.
when im calling methods within a server method implementation for some reason my float input isnt correct?
void USkill::Server_SkillShot_Implementation(APlayerCharacterBase* Src, APlayerCharacterBase* Target, int32 SkillID, int32 SkillLevel)
{
switch (SkillID)
{
case (ESkills::WA_PUSH):
int32 ExtraDamage = CalculateAttackRatio(Src, SkillID, SkillLevel);
Status->StartStatusChange(Src, Target, EStatuses::STATUS_PUSH, 0.f);
Status->StartStatusChange(Src, Target, EStatuses::STATUS_STUN, 1.f);
}
return;
}```
should be 1
I've struggled with this all day, I have a build system that has been working as it should before I switched to using Enhanced Input system. Now the networking seem to have taken a hit. For some reason, the client seems to be out of sync when it comes to the value of "bIsInBuildMode" where when I first press it "EXIT BUILD MODE" is being printed and vice versa.
bIsInBuildMode is (Replicated, Reliable).
how do I calculate angular velocity (Yaw only) from current and previous data ?
CurrentYawVelocity = FRotator::NormalizeAxis((GetActorRotation().Yaw - PreYaw) / DeltaTime); ?
Solved by adding an OnRep function where I switch context and check for bIsInBuildMode.
@thin stratus no problem, let me try to explain it a little better. On my multiplayer map there is spot A and spot B. When player A host the game I want the multiplayer map to spawn a bunch of items that all players can use to build things. Player A gets spot A to build in. When player B joins I'm trying to get what player A built in spot A to be replicated. And then whatever player B builds in spot B to be replicated as well.
Just spawn things on server and make sure they replicate. That's all about it.
Has nothing to do with #multiplayer
Whatever value you pass the rpc it will pass just fine, especially that we talking about primite data types. We can also see you are passing 0.f, so that can be it.
I can't check now, but iirc it is.
hey, would it break networking if i override PerformMovement and do my own velocity and acceleration calcs there, and ignoring the use of StartNewPhysics
hmmm that might be a better idea
that will get called regardless of what physics state the player is in right
i want to port this into UE:
https://floodyberry.wordpress.com/2008/04/11/tribes-1-physics-part-three-collision/
i know how to make it work using UE's sweep test but im not sure where I should put it
Hm not entirely
Different phys states might have different functions
Like falling for example
hmmm maybe it would be better to use the custom physics state and write the code in there
heyall! Small question, I hope.. I've got player1 in-game, and then player2 joins. On the PC of player1, the PlayerState::PlayerId is 0. Anyone any clue how I can fix this replication bug?
Anyone know why a flashbang UI effect would show on the server pawn but not the client?
then it does the flash ui code which works fine on server, both characters see the cosmetic explosion but only server gets the UI flash
It doesn't work on the client because you're using a Server->Client RPC. The name gives it away "Run on Owning Client" which you likely wouldn't give ownership to a client for this type of actor.
Change that to a multicast and it should work for all.
Hmm nope still the same result, maybe there's something in my ui code i am missing
It's weird because the explosion radius is registering the correct pawns being hit
anyone knows if playerId on the PlayerState should be valid on ALL clients?
Ah it seems my widget is not creating for the client on beginplay
assuming that player state is replicated to all other clients, then yes.
i have a problem where i use the "get player array" from the game state, but it simply returns a single player state when i PIE with 2 instances.
What's wrong here?
It's like it doesn't even create the second player state, yet i can still move the ingame camera with both instances
So the player controller exists
Or maybe it doesn't. It fails to cast to the owned player pawn
I am so confused
Shouldn't a new player instance spawn a new player controller, player state and player pawn?
according to the cpp side of the engine, playerstate's always replicated. but ty anyway ^^ I've found another variable called uniqueId that seems to do exactly what i want
EDIT: Turns out it's not usable from Blueprint...
Figured it out. Thanks for tickling my brain 🙂
Widget wasn't initializing for client.
yeah that's what i assumed the process would be, here's my code setup
1.) i start with calling (first image) on the begin play of my platform bp (this is a build location on my multiplayer map, Spot A)
2.) it performs (second and third image) to spawn the parts in the map (this code is in the gamestate, not sure if that is the right location to have it.
3.) when a player runs over a collision box (image 4) it then assembles the parts on platform bp via code (image 5) that is also in the gamestate
image 1 is in platform bp
image 2 & 3 is in gamestate
image 4 is in platform bp
and image 5 is in gamestate
thanks and sorry for the long post and images
Begin Play also fires on the server and you shouldn't need to have the client tell the server about it beginning play in this instance. You can determine if it's server's begin play by using a HasAuthority node and using the Authority path, or by checking IsServer() in a branch. Server->Client RPCs require the client to own the actor that you're calling the RPC on, so that RPC may not even be firing unless the client owns that actor.
Same with your overlaps. Those can normally be detected on the server, and you can validate if it's server detecting the overlap, no need for the client to tell the server through an RPC that it overlapped.
ok ill try restructuring my code and will get back
I have a big (5k) order-sensitive TArray which I want to replicate. I implemented a netserialize which compresses it, but it's sad to lose delta serialization. What can I do?
Fast TArray replication does not preserve order so it's not good for me.
you can use fast tarray replication but have your own ID, and via a linear lookup you can provide reliability
in case you can afford 4 extra bytes in your data structure
also you can always chunk the array and send it in chunks manually over the wire
controlling for sure the bunch size
and as long as you keep monitoring your reliable buffer -- if you decide to follow this RPC based solution... watch out for logins and disconnections
Anyone know if FastTarrayItems have a limit to how much data can be in them? I can send 3 floats and an int32 but 7 floats and an int32 throws an assembly code error (maybe serialization?)
ugh not sure about this one... but... 7floats +i32 its 32 bytes iirc
its not much
try to cull the floats using compression and see if it lets you send it over the wire
Hahaha yeah I'm really having a hard time debugging it when I just get pointed to assembly. Thanks for the input vori!
Will do!
It's an array of 5k bytes, I can send it all after zlib compression in one RPC. It's just it's a waste to always if only one element has changed. I wonder if it would be possible to check how big the change is, and if too big I just compress&send
Now, I need an example about how to use these methods. I'm looking at the source code from the Epic's Shooter Game sample project and I think they use the GameSession class to do what you did in the GameInstance class.
I think you are probably doing it the best way possible without adding extra clutter and complexity. If you really wanted to improve on your solution I'd use delta replication and keep an order yourself like what Vori said rather than getting nitty gritty with the compression.
I've narrowed the issue down, it seems to be dependent upon how many items I add to the fast array immediately on begin play. ~1000 is fine, ~2000 throws that error.
Hard to see the error. Max changes in a Fast Array per update is 2048
Where is this number defined?
There are CVars in FastArraySerializer.cpp
because it matches to the description of what Erik is saying
But also, replicating an array of 2K elements... 🙃
Bwahahaha I know I am trying to replicate Instance Static Mesh Elements
At some point, you're gonna hit a ceiling
Yup I'm probably just gonna throttle the loading and call it a day
Just break the ISM into smaller chunks
(or generate from a seed, rather than replicating them all)
yes, please
I'd love to generate from seed but these are dynamic objects hahaha
To replicate my RTS units, I split the 1-2k i to 10/20 chunks, so each RPC is only 100-200 elements
RIP
might work
but indeed, rather than using replication, you might also use chunked rpc's
just be careful on how you do it
and watch out for logins...
Can you not even generate the initial setup from a seed and just replicate deltas from that point on?
Still not ideal though, as then you have highly variable cost
can also treat it with deltas, but it's very manual
whereas the first "replication" is just checking against the reliable buffer
I think... best solution is to just dynamically split up my Instance Static Mech Comps when they hit a certain limit of elements.
Thank y'all for the awesome input tho, y'all are lovely and I highly appreciate your input
Jambax's seed and delta idea is what I am using for terrain
no worries, there are a couple of techniques I learned about after speaking with Zeblote on how he approaches brick replication
quite interesting if you ask me
I can confirm that updating 1k items in 10 chunks (per second) worked perfectly in my context with two players
How can I fix this issue? I add the input mapping context on the player controller on begin play, it only happens if I run 2 instances, if I were to do singleplayer there would be no issue (1 instance)
Can you show me a screenshot of your character bp please?
I'd definitely do the RPCs if I wasn't worried about hitting the limit of 2 rpc calls a tick and didn't need people to reconnect. That was my initial implementation actually
you can check against the reliable buffer and do send over time, bu having track of what you could send and whatnot.
Sure, the issue also seems to go away if I put the AddMappingContext in beginplay on my character instead of the controller.
I would do that then
Yeah... that would get messy hahaha, idk if I am smart enough for that implementation. 😅
I will write a post about that, because it's quite interesting 😄
@pallid mesa Thought I'd share something of my own since you have helped me out so much. You can use the Replication ID of a FastArrayItem to populate an Instanced Static Mesh Component Instance ID if you offset by 1. (ReplicationId -1 = InstanceId) to make ISMCs with replicated and synced Instance Ids for O(1) Adds and Removals. From my testing I think it would work up until ReplicationId hits int32 max.
Can you rely on the ReplicationID to ensure order?
I believe so, Give me a day or two and I'll have some solid stress tests
You do need to be careful doing that
ReplicationID is syned and replicated, but you have to be careful because it increments constantly. It's also dropped by copy constructor etc.
Incidentally if you do wrap, it'll break
Yeah wrapping will break hahaha
Hello, the camera starts jittering for the client when moving on a server, can someone tell me why, please? (edited)
Fast Array doesn't actually guarantee that RepID is unique, but it's a fair assumption that you won't exceed 4 million unique item insertions
Hahahaha yeah
Sorry - I'm making Borderlands.
You'd also be better off not removing, and just updating existing ID's instead
That way you can also benefit from per-item delta replication
But, frankly if you have a fixed order - you'd be better off avoiding fast array altogether and using a static array
A fixed-size array will still rep faster
Fast array is meant for large data sets with removals/adds anywhere within the array
It's not always faster/cheaper than simpler methods
As in:
UPROPERTY(Replicated) FInstanceData Data[1024] etc.
Use push model to mark indices dirty
Definitely better of not removing and just updating existing Id performance wise. But that is the step that would overreach the amount of complexity my tiny brain can handle hahaha. You are on another level my friend. I didn't even know you could do delta serialization without Fast Array. I shall look up what push model is hahaha.
Thanks for the tips!
Well, by default everything delta-serializes. In fact before 4.27, fast arrays were one of the few things that could NOT delta serialize
But you will save masses of additional overhead if you can use a static array, even more so if the individual elements are atomic and can be packed/compressed
For most applications though, static arrays aren't that useful - but if you have a chunk of data that is always the same size, it's a win
You have expanded my horizons thanks Jambax! I have new things to google! I'll take a look and see if Static Allocation fits my needs. I greatly appreciate it!
Hello, I am hoping someone can point me in the right direction as I think my understanding of replication is causing my issue.
The issue is that on the Character actor on the Event Possessed, the “Is Locally Controlled” bool is True on the Host but false on the client.
The game is currently running on a LAN connection with the Create Advanced Session from the Steam plugin. This is also a listen server.
I’m trying to figure out why the Client does not have local control.
Thanks. I'll take a look at it 🙂
Because event Possessed gets called on the server only and for non-hosts players their local controller exists on the client
ohh really? why is that?
Thank you! I can't believe I missed the big server icon on the event.....
Now originally I thought my issue was related to the client not being owned but that did not fix it.
When the character spawns it runs this function, however the Set Owning Player Variable does not update for the Client. It gets Null.
I tried adding a delay but that did not help either.
The function is not replicated and runs once when the character spawns.
I can't tell what event drives this code from the cropped image
A full screenshot would help
First image, this is the start of the event that I updated after your help earlier.
Second image is the function that calls the first cropped image
The Create - Add HUD is called in the Tick event after the Do Once.
is it better keep spawn location in game mode or game instance?
Well that's clearly not how you spawn widgets. Tick fires way before your pawn is possessed by a PlayerController and that will yield in IsLocallyControlled returning false. It also can result in that do once not doing anything because it already failed because of that other function.
Does your game need to know the spawn location on the main menu?
You create widgets inside HUD class on BeginPlay for example @late scarab
HUD is known to be a good widget manager and it also exists at the local controller level so you don't need to check anything
omg - did it get bigger? @fathom aspen
no it doesnt
This used to be 41 minutes, I swear

There ya' go.
GameMode it is.
GameInstance should be used for things that should exist throughout the lifetime of the game.
It did, but I added some materials from the docs so that peeps can refer to one source, considering Epic's source has misleading info
Ah - going for the monolithic blog approach I see
There is this now btw: https://wizardcell.com/unreal/persistent-data/#url-built-in-options
Ah okay, so rather than creating it on the character BP I should call a function from the HUD to create it?
Basically moving this part to the HUD.
Correct, that way you don't have to deal with 90% of the stuff you are dealing with now
And you can always refer to HUD to interface with widgets
thanks mate! 
I used to call this function on the begin play event however, I had the issue of the begin play running before the character was possessed.
Sounds like I should have kept it off the character to start 🙂
Thank you for your time. I'll give this a shot 🙂
Correct BeginPlay has that issue too
Use the controller to manage the AHUD instance. Characters/Pawns should have no knowledge of UI imo
That's why if BP peeps want to do something locally when pawn is possessed I suggest them to fire a client RPC when Possessed gets called
But spawning widgets shouldn't really be mixed up with character
Oh that does sound like a good idea. Had to do this a lot in Unity.
I used the tick just because I wanted it to keep trying until it was controlled.
Correct, UI should be another separate layer that just listens to the gameplay layer. It displays state while the latter holds it. @late scarab
🤣
That mf gonna explode the whole thing
I wonder what happens when I pass the 1 hour mark? Does it start counting in hours? Or does it keep saying mins?
I'm not eager to tell as of now, but I can't find someone who did it 😔
Do the same rules apply for references to the widget?
In my case I have all the player stats, max health, etc on the character and it updates the widget when something changes.
Here's more of an API design question - do you think, when writing something in C++, the server/client RPC stuff should be exposed to BP designers?
Example:
ChangeWeapon
ServerChangeWeapon (obviously this is the Server RPC)
Do you think it should be exposed to BP where the Server version is callable as well as the non server? Or just one or the other? Internally though, it does work properly.
That too, why would a character hold a strong reference to a widget that they have no ownership of. Well even making that a weak reference will still look ugly as that can clutter the character class with needless references
Literally talk to HUD and make HUD manage the widgets. It's just another level you have to go through, nothing more.
Okay I think I understand.
If the widget needs to be updated call a function on the HUD to do it.
Currently I am calling functions on the widget on the character when needed.
So long story short. Move functions to the HUD.
Hmm, I wouldn't expose the server RPC (does UHT even allow it?) but instead have a function that is called as part of that server RPC. For example RecieveChangeWeapon with BlueprintAuthority tag so that way designers can tell it's a server event. This way you can also guarantee designers don't call a server RPC at a point in time where it might get dropped 😄
Laughs in SQLite
iirc I used SQLite as a test/dev database once, while working with PHP/Symphony
the real database was postrgresql
UFUNCTION(BlueprintCallable)
void ChangeWeapon(AActor* NewWeapon);
UFUNCTION(BlueprintCallable, Server, Reliable)
void ServerChangeWeapon(AActor* NewWeapon);
Well, I'm not saying expose the _Implementation part. But exposing something like so.
the learning experience was learning how to write that name
Right now, I'm in the camp that the designer should not be exposed to the RPC stuff directly.
sounds reasonable
So only the regular ChangeWeapon is exposed.
Yeah I was referring to this. Yeah UHT allows it, I might have seen it in the engine before, but not that I recall it now. But still my answer holds
I mean, I guess it depends on who the designers are and how the project and workflow is
Well - it's my project and my company; so I can do w/e the heck I want, lol.
My thought process is that designers shouldn't be exposed to the nitty gritty, they should just do their stuff and not really worry about it as much as possible.
Yeah sounds much safer than to let designers deal with RPCs, especially server ones (security-wise that is xD)
But it's more about them creating non-working code than security I would say (considering you implement _Validate in cpp)
In general, the way I design systems is for the end-user comfort more than my own. Should be easy for the end-user (currently it is mostly me, but when I onboard future programmers/designers, I'd like to have these rules already in place)
In that case, it depends more in who are the designers etc. Generally speaking, I would be on the side of caution and not expose anything unless it's really necessary
theres no way to properly do networked movement in blueprints is there?
GMC plugin?
There are many "proper" ways.
Everyone has their own take and there's no one definitive answer.
do you have one for example?
In only blueprints, though, it'll be a challenge.
Depends on the type of movement you want.
I think that's what they meant, and I don't see it feasible at all xD
i see 😔
What
The fuck
You need a map or something my dude
lol it surprisingly all works, just cant get it to replicate correctly not sure where im messing up at
I have a replicated Actor with a replicated ActorComponent.
When the RepNotify/OnRep is triggered for the parent Actor, am I allowed to assume that its children have also been replicated? Or, should my mental model be, only the object that the RepNotify was fired for, has been replicated, and its replicated fields may still be uninitialized/null/invalid?
Though AFAIK, if the ActorComponent was created and attached to the actor at the same frame then they will make it in the same packet @uneven kraken
Okay, thanks Hunter & WizardCell!
Assume nothing in #multiplayer
But again Hunter's answer for safety. And soon enough with Iris we'll be able to make some nice replication assumptions
Some assumptions being made huh
I'll believe Iris when it is actually being used
Still nice to peek through the source to see that it's aimed to make our life easier 😄
First time I've heard of Iris, sounds potentially amazing, are there any estimates on its development timelines?
How so? As far as I know it is supposed to help with replicating more stuff.
Yeah it's becoming stable at 5.13™️
Apparently UE is trying to be more MT overall from my understanding
Throw more cores at it baby ❤️
https://github.com/EpicGames/UnrealEngine/commit/1ebe3aecd55270ecdd6500f094a0952c4779fe34
While this is not really true Iris, but it's a bit related
I want them to depreciate stuff and then actually remove depreciated stuff
I still find depreciated stuff from like 4.17
And iirc I think that assumption will be valid for actors too as part of Iris
But if that happens then I won't have fun telling peeps not to fire RPCs from BeginPlay 😔
Let's cross one hurdle at a time ya'll. Let's focus on seeing if Verse will be worth a damn. Epic only has Fortnite money, so they're kind of struggling.
What's the problem with firing RPCs from BeginPlay?
Indeed, Fortnite has to succeed for us to enjoy the new gems 
Not having a net connection yet
Exciting times for 2028
Yeah I haven't reached that part yet, but I'm already guessing they must have changed something on that part, which is a big change really.
Unsure how I feel considering I will feel beginner™️ in #multiplayer land soon™️
If I can't make my BP only MMO with Iris, is it really an upgrade?
Good question
One could hope.
Sometimes feels like they have a requirement to maintain backward compatibility
Oh yeah lowkey that bothers me. But we're already bloated 
How else would we get stuff like this
4.17 - I think it's time to just remove it bro
I'd be fine with like 2 or 3 version warnings to be honest. With how many clients Epic has with UE - that should be more than sufficient.
Whoever chose the original name must be sued.
If it don't crash the game, it doesn't matter
The problem with warnings is that they are yellow.
Not enough urgency
Hey ya'll - is it possible to replicate a 2D Scene Capture Render Target? For example, one player has a screen that allows them to see the other player's camera view.
Absolutely, but I think the best solution would be to just swap the player's camera position to the other player's view. Replicating a render target would probably be terrible for performance.
@glossy drift Ah, so have a local camera that tracks the position of the other player's camera and just render that camera to a local render texture?
yup!
when we SetControllRotation in Autonomous proxy, how and where is it send to server ?
and I want to get the controll rotation on server when its arrived .
looking for a way to get controller angular rotation
in brief
I want to have angular velocity of my actor and play some animation based on that
Hi!
I'm checking the AGameSession source code (cpp file) and I've found this comment: Acts as a game-specific wrapper around the session interface. What does game-specific mean?
Thanks!
Are there many kinds of game sessions?
Game here probably means it has winning/losing matches/players etc
when i host a game as soon as i spawn it instantly goes to the menu like the server closes
I though it means co-op games, deathmatch, etc.
Either the whole game or the current match
Hello. I have a quick question about Sessions in Unreal. I have implemented all the code related to sessions in a class that inherits from GameInstance. But, there is another class, the AGameSession. How do you use this AGameSession class? In the documentation says that it acts as a game-specific wrapper around the session interface and the game code makes calls to it when it needs to interact with the session. But, I think I have implemented this wrapper in the GameInstance class. Thanks.
You can still communicate with the Session code from there if you want
Didn't I already tell you that the AGameSession class only exists on standalone and server?
Your best bet is to look at Lyra, ShooterGame or Unreal Tournament
And see what they do with the class
Other than that, no idea, I haven't had to use the class much if at all in the past 6+ years
is there any data type or enum for ENegative, EZero, EPositive?
I dont want to use int8
Im just replicating sign
use a int8 bitflagged one
int8 Sign : 1;
at the end of the day, sign is binary, It's positive or negative. (Assuming 0 positive non-normative)
when I posses a pawn, its rotation is set to the rotation of Controller, however I set the control rotation to zero before possess
when is it set ?
Yes, you said that. But I'm asking if it is useful to have an AGameSession class if I have implemented all the Online Interface in a GameInstance.
Again, I would have a look at those 3 projects
Yesterday I was looking at the Shooter Game, and they use GameSession. This is why I'm asking to understand the differences:
Thanks.
But you don't need to answer. Now, I have a better idea about the differences.
So, just based on where you place the Session Code, there might be no difference.
The main difference and issue I encountered is that if you are connect to a Server, as a Client, you lose all access to your Session Code
Thanks again.
Means if you want to call FindSessions while already being connected (if your game supports that), then you can't, because there is no AGameSession object for clients when being connected.
And since it really doesn't matter much where you place the code, despite "AGameSession" fitting more name-wise, I usually place it into a GameInstance Subsystem.
That ensure everyone who uses the tutorial, even those who need to use Session code as a Client, can do that
Hi guys, I have upgraded to 5.1 and seems like I have the IRIS networking plugin installed. How do I use it?
Will movement replication now be done by iris?
or do I have to set it up
Hello, the client is jittering when I start/stop moving, can someone help me resolve this?
@timid moat u wanna know the real meaning of shit ? its GameSession, OnlineSubsytem and lots of other classes that do nothing but just passing data to eachother
What does IsNetRelevantFor typically use as the SrcLocation? It is passed a playercontroller, a pawn, and the fvector, but cannot see where it comes from
It comes from a FNetViewer's constructor, it equals ViewTarget->GetActorLocation()
Debugging editor is giving me the location that it's using via the ClientConnections as X=1755 Y=2321 Z=744 but if I UE_LOG(LogTemp, Log, TEXT("loc %s"), *PC->GetViewTarget()->GetActorLocation().ToString()); then I get X=1493.047 Y=1957.460 Z=548.651
Then you are not looking at the ViewTarget the engine is looking at
In that ctor it's InConnection->ViewTarget
I would debug and see what that is
They the same
I'm talking about this: FNetViewer::FNetViewer(UNetConnection* InConnection, float DeltaSeconds)
Oh
if (ViewingController)
{
FRotator ViewRotation = ViewingController->GetControlRotation();
ViewingController->GetPlayerViewPoint(ViewLocation, ViewRotation);
ViewDir = ViewRotation.Vector();
}
It does this
Right and look at the line before that if
That's basically what you're looking for
Oh right it changes inside that if, that's an out param
Yeah then look what happens in there
That did the trick. Thanks 🙂
Hey how do I client travel if I'm not using any subsystem or plugin?
How do I get the TravelURL?
Is it just the IP of hosting server or is there something else also?
I have the public IP address of Hosting player's session. But Client travel to that doesn't work even after appending :7777
i.e., their external IPV4 address
Is the port open? Are you sure it's using that port?
And what command are you using?
Yes I'm sure its using that port. But about it being open
Do I have to explicitly open ports even if I'm using a SDK to join and host sessions?
Honestly not sure. I would try forwarding the port on your router to test first.
I'm not using any commands. Its a listen server and I just do ServerTravel with ?listen to it.
And on another machine, I just find session and join it successfuly but how do I get to that same map?
A session isn't the same as joining a game.
Ok so what will I do when I publish it? How am I supposed to open port on hosting player's router?
😦
Try forwarding the port manually to see if that's the problem... if it's not, investigate other potential problems!
Ok and if it indeed is a port forwarding problem then what would I do?
what is steam sockets :/
I don't know
Where should I learn this? Do they have docs better than unreal's?
Alright thanks. I'm on it 🙂
How do Steam sockets work? I guess theu route the traffic through their servers to avoid NAT issues
Interesting, they use WebRTC for P2P traversal
Supposedly steam sockets is broken in 5.1
I'm mainly interested in the WebRTC stuff
having p2p connections without relying traffic to servers + no port forwarding
how can i replicate a physics object in such a way that the client can also change it's position and rotation? i have a telekinesis skill that changes a physics object's position, but only the server is able to do it
I thought the usual p2p for NAT punchthrough was to reroute the traffic through other servers
Although I remember somebody talking about WebRTC as possible modern solution
Nope.
A NAT punchthrough is a router thing.
It means that you send out a message to/from specific addresses, the router opens the path for a return.
You would probably punch through to a server I guess, but it doesn't route the traffic through the server.
Ahh, I thought it did
It allows the other client to connect to you directly through the now open port.
I see
I did some research about the topic (although I'm not the one handling it in our project) but found the router/NAT stuff a bit confusing
NAT is basically "I see a packet from port x from the internet, I will translate this to lan ip on port y"
Yeah, my understanding is that the router makes a second layer of ports/ips so that incoming connections don't necessarly know how to find the right computer
for "safety"
although I also saw people say it's not really that much safer
Don't know about a "second layer". It's pretty irrelevant to how the system works for games.
You don't need to know how mouse hardware works to control your player camera. Same deal.
Ohh agreed. I was just trying to understand how to do the punchthrough, bcs port-forwarding is quite annoying
Yeah, I wouldn't rely on anything that needs manual port forwarding.
how do i do that? i really didn't want to bother you by asking this, but i've tried everything i know to no avail
I have a question for multiplayer peeps! What is the main variable that gets replicated to other clients that allows their animations to run? Is it velocity? E.g we use speed and direction for a walk/run blend space. Which variable is replicated from the character movement component to allow those animations to run?
velocity is one variable you can use, and you can transform it into a single scalar using the length of the vector that you can use to drive your anims
I recommend you taking a look at the state of the art solutions available in the learning samples tab
Lyra is a good example to learn modern animation techniques
I've personally learned by looking at the UT's animation graph a while ago
Why should you replicate Velocity as it can be calculated locally?
ahh yes I turn velocity into speed using the length/magnitude. And thanks, I'll definitely look up those resources. Where would be the best to go for syncing up feet placements? Do I research "foot IK" or something?
Oh I'm not sure, I'm not replicating anything myself right now, just curious to know what the character movement component is doing automatically for animations right now
Most of the Anims work without replication. You could replicate f.e. Blendspace Integers to everyone, so when you Carry a AR its different from a Shotgun. Other than that.. hm.
Yes animations are run locally, was curious to know what is being sent from the server so our proxy clients can animate on our screen
feet IK now is part of most epic samples, including third person sample
Look into the Third Person Anim BP, you can See that Most if Not Everything inside of there is calculated locally. Velocity is for sure replicated inside the Move comp but Not within the animbp
thanks! 😄
do you think these modern animation techniques in lyra are performant for big multiplayer games?
Replicated variables can only be changed on the server if I want the change to be replicated to other clients right?
depends™️ it's not about replication, because you don't replicate data... but animation logic is a whole amalgam of transform operations that can get a bit expensive, so use the profiler 👍 @dry pebble
yes, was curious more about the cpu usage as they are done locally. And ahh good idea about the profiler! will prototype and test with that
also there are techniques to reduce the significance of the animation logic and do throttling in favour of a smoother experience for your autonomous proxy in terms of CPU time... but the more solutions you add to the pile, the more code you'll have to mantain
so my main recommendation is... tackle only the problems that you have
ahhh I see, are you talking about the new multi threaded animation update? https://docs.unrealengine.com/4.26/en-US/AnimatingObjects/SkeletalMeshAnimation/Optimization/
That's fast pathing, which is always your go-to. Was refering to this thing: https://docs.unrealengine.com/4.27/en-US/AnimatingObjects/SkeletalMeshAnimation/AnimationBudgetAllocator/
oh wow haven't seen that, thank you, will read it!
Have in mind Fortnite is a mobile game, so some of these optimizations are a must in their context... at least given the low spec ratio they aim for
right I see, makes sense. so I may have more wiggle room with a PC only game targeting medium to high end PCs
End of pfp era that is 
anybody know how i should make an rpc that sends a physics object's transform data from the client to the server?
Fortnite has served as a development sandbox for UE4, and in this presentation from GDC 2018 we explore the effort involved with taking FNBR from 30fps to 60fps on consoles.
Learn more at http://www.UnrealEngine.com
Mark event as "Run On Server", give it a Transform input.
and i connect a get actor transform node to the input?
Sure
omg you're so resourceful, thank you! -madly copying all the links lol-
I hope it'll come back
so this is in the object's bp, the second image is in the player bp. should this change the scale when i walk into the object?
@whole grove Can you hit me with what I need to get started with MJ stuff?
aaand i just tested. the answer's no
No. You probably can't run the RPC on the "Magic React Item" itself unless the player is the owner of that actor. Additionally, as you're sending through a transform, you're supplying three parts: Location, Rotation & Scale. If you attempt to use just one part, the others would still apply. If you only intend on using scale, then send through only a vector and you can later apply it rather than sending a whole transform.
When you run the Multicast, you've so far not doing anything with the event - you're calling for something to happen, but haven't given it any instructions on what to do when that event is called. If your intention is to have something changed on that actor, you need to actually use the appropriate nodes to tell it what to do when that event fires.
so i populate the multicast the event with the actual instruction on what values to change?
Yep
should i promote transform to a variable and use a set node to change it's values?
or should i move the rpc code out of the item
I'd really recommend if you're this new to unreal you skip the multiplayer bit for now. Just try to get it working single player first. Look up what you need to do in order to set the scale of something. Once you've learned how to do that, then it's a matter of converting that to multiplayer which is mostly about input -> replication -> results.
For what its worth, you probably won't need to multicast anything. You'd make a variable for your scale value as a replicated variable w/notify, and on the OnRep function, you'd set the scale of the object.
So then before that, it's a matter of sending any data you want to send to the server, the server then sets the value.
So then before that it's a matter of having your client successfully send an RPC to the server with the data you want to send, which has to be done on a client owned actor like Player Controller/Playerstate/Possessed Pawn.
Does anyone here is using rider and knows if it’s good to use just rider for databases?
If you're talkin' about connecting to a DB - it works well enough.
im talking about the whole functionality of the db
You're connecting to a DB and using it. What more do you want?
Rider itself is not a database
I mean I can code on that right?
Rider is an IDE - yes, you can write code in it
what do I need for the db stuff? just that right?
Completely up to you
for games
Answer is the same
You may or may not need a database
Completely up to you
How you do your database is also completely up to you
Maybe it is SQL, maybe it isn't. Maybe it's just using Steam's cloud stuff. Maybe it isn't. Maybe it is just some random json file on a server you own.
Completely up to you
Then use one?
yeah but just using rider for that is fine? I will miss features?
Rather than a full on DBMS tool? Probably.
But you have what you need for the most part
is datagrip a dbms?
like what features?
I never used db dedicated servers and baas so im learning about it.
it will be important for my game
I want to make an fps hero game like valorant and overwatch
so I dont know what are the tools I need
I just know that I will probably use AXR baas mongodb but I dont about know these other stuff
you think that rider will be enough for me too?
I know
but I already have rider and I dont know if thats enough
how can I know if thats enough or not
?
well i got something working, pressing right click sets the object's location to 0, 0, 0 and the change propagates through all the clients, but when i try to use a "get actor location" node to constantly update the actor's location, nothing happens
what am i doing wrong here? rmb is bound to US, but i did try making it run UM as a server rpc, still didn't work
you know when you set relative transform, its relative to root component, right?
ah, i see, so im using the wrong node to set the transform?
root component can't have a transform relative to itself, its always FTransform::Identity
Thanks!
well, setactortransform with the actor as the target also doesn't work
well, setting the actor location to itself also won't make any visible change
i thought of a control flow that would go like this
rmb -> run US event -> run UM event -> Change actor transform to the current transform in the client or server instance
when you go and think about it
that multicast fires
and now whatever comes out of it is executed on client
which means GetActorLocation/Transform is evaluated on client
and when you set that location as new location, nothing changes
AND something i've omitted and prob shouldn't have, rmb also activates a telekinesis skill that lifts the object
which is why the multicast is setup the way it is
client can't magically fetch actor location on the server by running GetActorLocation
which means, if you want to force update actors position via multicast, you have to... ?
get the client transform data and send it to the server?
the other way around
server doesn't care what client thinks about where the server controlled actor should be
send the position data down to the clients then
so you add a Vector/Transform parameter to that multicast
and i pass to the parameter where i want the actor to be?
yes
then the GetActorLocation is evaluated on server and sent to the client via that RPC
which makes client know the location on server
note: its still terrible way to update actor position, but it will at least work
so if i want the client to change the ball's position, i make the client tell the server where to place the ball instead of the client placing the ball by itself?
only place where you can multicast from with any effect is the server
client multicast is just a normal function ran on that client
rmb -> run server event -> run multicast event -> somehow get the client's transform data -> send it down to the other clients?
if client moves the ball, in this simple setup
then Server RPC would also have a vector/transform parameter
only way client can send data to server
this will result in a super choppy movement, but you got to learn to crawl before you can walk i guess
smth like this then?
client runs the server event and passes it's actor transform data to the server event?
teleporting? wouldn't it sync for the server as well?
it will teleport on server
unless you send it on Tick
but if you send it on Tick, then MC from server, you will choke your network
yeah...guess it would lag out, then again, this'll be the only physics object in the scene
