#multiplayer
1 messages ยท Page 196 of 1
No it's on a fresh project but pktlag is at 400
400 with variance of 50 i think and some loss
Then I guess that would probably check out. Is it fixed when you turn off the lag?
Yeah, I was mostly just wondering if that's just kind of how it is functionally.
I don't expect people to play a game with that ludicrous of ping, I'm mostly just wondering things
It's because the Pose of the Mesh is not Ticked every Frame on the Server but only when the Server receives a ServerMove.
Lower Client Framerate -> Lower RPC count -> Lower TickPose count -> Laggy
That makes sense. Thank you
/** True if calling TickPose() from Autonomous networking updates. See ACharacter. */
UPROPERTY(Transient)
uint8 bIsAutonomousTickPose : 1;
/** If true TickPose() will not be called from the Component's TickComponent function.
* It will instead be called from Autonomous networking updates. See ACharacter. */
UPROPERTY(Transient)
uint8 bOnlyAllowAutonomousTickPose : 1;
void ACharacter::PossessedBy(AController* NewController)
{
Super::PossessedBy(NewController);
// If we are controlled remotely, set animation timing to be driven by client's network updates. So timing and events remain in sync.
if (Mesh && IsReplicatingMovement() && (GetRemoteRole() == ROLE_AutonomousProxy && GetNetConnection() != nullptr))
{
Mesh->bOnlyAllowAutonomousTickPose = true;
}
}
The thing with that is that you could argue that it's laggy and looks shite and should be altered. And a lot of people do that. They override PossessedBy in their Character and manually call APawn::PossessedBy to skip the Character one.
And then alter the places in the CMC where TickPose is called manually.
But you destroy that "sync" they are talking about. Does that matter? I honestly don't know.
I assume it does
I almost feel like this is code from 4.0 or earlier that is still from times where Epic largely used UE for UT and similar, where DedicatedServers were more important
Would changing it so the animation isn't entirely dependent on the tick in that way mess it up? Like is there a better way to sync animations than constantly ticking like that?
Like with how it is if you tried to make a fighting game in this fashion i feel like it wouldn't work but i think i might just not understand it that well.
It depends on what they are trying to sync here
They clearly try to make sure that the Movement code is in sync with the Mesh Animation.
That would mostly matter if you use the Mesh specifically for something in relation to movement I guess
I don't really see the need tbh, but that is a very specific thing, so you might need to check if changing it breaks anything
Since the last time I disabled this it also changed abit, cause there are now like 4 places or so they call Tickpose in the CMC
Back when I did that there was one
I've seen people try and time hit boxes to activate and deactivate at certain animation frames around the model itself so I'm just wondering if that's a bad idea or what
Like use montages to send animnotifies to call gameplay stuff, I mean
And I'm wondering if this sort of jittery animation from ticking the pose would mess with that?
Also it seems unnecessary but I could be wrong. In a scenario where you cast a spell a single time and as long as it gets validated, would the tickpose still make the animation messy if the user's ping spikes at that time?
My knowledge of ue is limited so if I sound dumb just tell me lol
@mellow hatch Honestly, no clue. It makes sense to think about Montages here, as they often are used to trigger gameplay logic, such as enabling sword collision etc.
But since UE is damn bad with Prediction etc. outside of the CMC, I hardly think it matters if that's slightly off.
RootMotionMontages might be a thing to think about
at that point i think trying to use that better synced clock in pins might be better since i'd like to make a faster style game. probably the best for keeping things in time at that point?
Probably
or close to in time
another thing i was wondering is like, if i shoot a singular bullet, does that go in multiple packets? or like how does that work physically. if the packet gets lost does that bullet just not get fired or can ue tell if it didn't go through and try to correct the client at the very least or something?
Why is the variable not replicating to the client? For context that server event is called by a sequencer event. Oh and there also anothr float variable in the same blueprint that supposed to replicate but it is not too
[ Resolved: I accidentally checked only relevant to owner when this actor is not meant to have a owner ]
Hello people, I am trying to replicate a muliplayer jetpack effect on Lyra starting project. But I am not sure how to do it, any suggestion? Rightnow I call a function on the blueprint with a gameplay ability that checks if the player is locally controlled if it is it activates the jetpack vfx ans sound effects
Yo kaos gave me the solution
I scrap all the bandaid and didn't even toggle it
He said he ignored the forum noobs and sort it out him self ๐
I tested with listen server on steam, everything looks fine with the setting he provided
Hm, not sure the settings would help if the Client has low FPS and sends less updates. But it's been a while so if that works then great.
Hmm I certainly haven't test that.
Got like 40 fps on both of my computer
No idea how to artificially make it lower
ListenServer would need higher FPS than client to make that visible I guess
Start actual standalone instances and limit max fps on client
Oh I can probably upload development build too and limit the Max fps
Hey, what's the best way to design ai in a multiplayer context?
For example, if I tell the ai to go to a location near the client player, does it go to the last location the server thinks the player is, or will the client's copy of the ai automatically do local prediction based on the client character's local position?
You can prob do something better than what Iโve done so far ๐คฃ but should be possible yea I think
Guys, I have a question about how you can replicate the physics of a skeletal mesh, for example, clothing or weapons that have physics.
Greetings
(First person multiplayer game, fps and tps mesh is separated)
What is the proper way to attach wepon actor to character hand?
Attaching Actor itself, or its mesh component? (Actor is replicated, movement is not replicated, mesh is not replicated at all)
I have an issue, when server is attaching weapon to Third Person Mesh, all clients did it too - so clients will have weird first person wepon view
How to save multiplayer data in a Steam game? Where should the database be? Does Steam have data tables for each game that can be accessed from within the Unreal game?
Don't think Steam has anything out of the ordinary for Multiplayer Games. You can save locally and push that to the Cloud. If you need actual Database stuff you need to host that yourself.
HI I am working on a multiplayer game. we are using the Online subsystem but i is not working as intended. I am setting my session settings locally an them updating them with SessionInterface->UpdateSession(FName SessionName, FOnlineSessionSettings& UpdatedSessionSettings, bool bShouldRefreshOnlineData = true). this method is suppose to trigger a delegate to al players (p2p) but is only being locally. Anyone know hay is this happening or how to solve it?
Right now i am passing a String as session name
hi im working on creating a splitscreen multiplayer game and i wanted to know if anyone knows how to create fake cursors for splitscreen players
Sup guys! (I tried to explain before, but I believe I didn't express myself well)
I'm trying to work on a """match making simulation""". Currently players can create a lobby, where they can** invite friends from Steam**. But my idea is, when they play, they will look in the **list **and try to find another server that they can join, if it exists, they will join, otherwise they will **travel **with their **current **one and it will become **public **(becoming a possible session to join)
The problem is that when I use find advanced session, I don't want them to find the server itself, so I created all this logic:
https://blueprintue.com/blueprint/nctlq5h7/
but I'm failing in how to compare their current session and the others, which were found in find advanced session
I did packaging my project in game and dedicated server target i can join server using my local ip ,I can join with 2 clients ,My remote friend or I cant join the same match the last one tried to join will get fatal error
i dont have Game Instance on my build I didn't setup my Game mode with any logic
any Idea what causing this issue?
and if anyone know courses for dedicated server hosting joining logic paid or free plz share it thx
How do I get a player to spawn in a specific PlayerStart? I know i can use GetAllActorsOf Class, but that just gives me an array...
Which one do you want them to spawn at?
its just a stationary rock paper scissors that uses clicking on actors to make your choice. My real issue is how do I spawn the actors that the player can interact with in front of them, and how do i spawn the actors the Opponent can interact with but not have the player be able to interact with them. (Player clicking on opponents Actors does nothing)
I thought, Player 1 will spawn to a specific location and the options are given that players playerState to show that they own them. When clicked on, the actor checks if the playerstates equal each other and decide off of that.
but i really want the starting positions to be random and the interactable actors spawned in front of them.
Solve one problem at a time
I think there's a built in mechanic for a playerstartspot being "occupied"
so the first one grabs the first unoccupied start in the array
then the next one does the same thing
So if it's random, i'll have to figure out how to spawn the interactable rock paper scissors in front of the appropriate player.
Something I did in a project of mine was to get all the actors in the scene that were player start, after that I did an each loop to get the transform and "tag" of each player start. Then I used both data to be able to determine which player I would like to place in location "A" or "B"
is that player start tag just a Name Variable?
you can put tags on your players starts on scene
that is a lot of help if i decide to go that route!
Sup guys! (I tried to explain before, but I believe I didn't express myself well)
I'm trying to work on a """match making simulation""". Currently players can create a lobby, where they can invite friends from Steam. But my idea is, when they play, they will look in the list and try to find another server that they can join, if it exists, they will join, otherwise they will travel with their current one and it will become public (becoming a possible session to join)
The problem is that when I use find advanced session, I don't want them to find the server itself, so I created all this logic:
https://blueprintue.com/blueprint/nctlq5h7/
but I'm failing in how to compare their current session and the others, which were found in find advanced session
How would I print out the netmode of whatever is calling a PrintOnScreen method in c++? Like if you do print string in BP, it says Server: message or Client 0: message
hey, I have a weapon manager component that has an array of weapon actors, that array is replicated and the weapons are replicated and being spawned on server which then causes them to spawn on clients. As I spawn them I add them to this array here but the clients are showing empty arrays on their ends...
UPROPERTY(ReplicatedUsing = "OnRep_WeaponInventory", Transient)
TArray<TObjectPtr<AInventoryWeapon>> weaponInventory;
When spawning it more or less similar to this but I am doing some more setup and attachments in the for loop after spawning.
weaponInventory.SetNum(MAX_WEAPON_SLOT_COUNT);
for(int j = 0; j < MAX_WEAPON_SLOTS; ++j)
{
auto* spawnedWeapon = GetWorld()->SpawnActor<AInventoryWeapon>(spawnWeaponClass, character->GetActorLocation(), FRotator::ZeroRotator, p);
weaponInventory[j] = spawnedWeapon;
}
Use weaponInventory.Add(spawnedWeapon);
Instead of directly assigning it
Or Insert()
If you want to keep adding via the index
GetDebugStringForWorld(GetWorld());
you can also add a debug watch: {,,UnrealEditor-Engine.dll}GPlayInEditorContextString so you see what that is when breakpointing/stepping
hmm, I tried that and still to no avail
Is the Actor set to replicate?
Probably might also want to remove the Transient specifier on there as well, not sure what mess that might be creating.
Well transient is for runtime non serialized things right? My weapons arent spawned until runtime
Transient means that it wont serialize at all.
It could be whats causing it to not replicate
Yeah the actor weapon and manager component are both set to replicate and I replicate the array with DOREPLIFETIME(UWeaponManagerComponent, weaponInventory);
ok worth a shot
nope.. hmm
What is the UWeaponManagerComponent attached to?
What Actor?
Is that Actor replicated?
The component is attached to my player character
I have an enum on the component replicating, its the array thats the issue, I am not sure why though, it must be my setnum stuff perhaps?
so weird...
Seems like you are wanting to pre allocate the slots.
You should be using Reserve instead
And then just Adding the same number of Weapons to the Array afterwards.
well, to be totally honest, i would rather a static array but I lose some nice begin/end and num functionality and epic sucks ass and made TStaticArray or whatever it is not exposed to reflection..
I dont want to exceed the max size ever and most of my code already protects for that, regardless of it still having the ability to still grow if I were to make it
Why do you think you need that?
a capped size array?
Yes
Well I dont need it, I am trying to do without now and doing set num to ensure the index of the weapons but its not working
So to restate the issue. You are preallocating a bunch of Weapons on an Array that is set to replicate, however the Clients are not receiving the replicated Weapons?
Clients are receiving the replicated weapons because I can breakpoint my OnRep for their behavior and it runs on clients (for example OnRep_Ammo, or OnRep_WeaponTag for the weapon actor itself), my array of those weapon actor pointers (to be able to actually reference and use them) is empty on the client, even after the weapon actors themselves replicate and spawn on clients
Hi,
Question about Seamless travel in multiplayer (dedicated server)
Without seamless, my gamemode BeginPlay spawns actors, and I destroy them in EndPlay.
With seamless, my gamemode BeginPlay spawns actors, but when EndPlay is called, the actors are already destroyed.
Why is this?
Thanks
I assume the world has destroyed them in that case (you did not specify anything about the actors in question or which endplay this is)
hello, I do not know why my custom movement is not working in multiplayer, I used first time the PhysCustom function to code it, I am switching to it in PhysFalling function, I have other custom movement like sprint, custom swimming etc. and it works with prediction (because it is coded properly I think) but the ladder move do not :/ Don't know why and what I did wrong. Looks like server do not have information about player moving. I thought that PhysCustom is already handled by engine to replicate it
void UDXMovementComponent::PhysCustom(float deltaTime, int32 Iterations)
{
Super::PhysCustom(deltaTime, Iterations);
if (bIsLadderClimbing && CurrentLadder)
{
FVector ViewPlaneNormal;
FVector VPN_Right;
float PlayerForwardInput;
float PlayerRightInput;
GetLocalInputVectors(PlayerForwardInput, PlayerRightInput);
GetViewVectors(ViewPlaneNormal, VPN_Right);
float ClimbFactor = 0;
if (ViewPlaneNormal.Z > -0.75f)
ViewPlaneNormal.Z = FMath::Clamp(ViewPlaneNormal.Z + 1.5f, -1, 1);
FVector NewVelocity = ViewPlaneNormal * PlayerForwardInput * LadderClimbSpeed;
NewVelocity += VPN_Right * PlayerRightInput * LadderClimbSpeed;
GEngine->AddOnScreenDebugMessage(991, 1.f, FColor::Cyan, "VPN: " + ViewPlaneNormal.ToString());
FVector ScaledLadderNormal = LadderNormal * FVector::DotProduct(NewVelocity, LadderNormal);
FVector Lateral = NewVelocity - ScaledLadderNormal;
FVector ClimbVelocity = Lateral;
DrawDebugLine(GetWorld(), UpdatedComponent->GetComponentLocation(), UpdatedComponent->GetComponentLocation() + VPN_Right * 300, FColor::Green, false, -1, 0, 3.f);
Velocity = ClimbVelocity;
CalcVelocity(deltaTime, 1.0f, false, GetMaxBrakingDeceleration());
FHitResult Hit(1.f);
SafeMoveUpdatedComponent(Velocity * deltaTime, UpdatedComponent->GetComponentQuat(), true, Hit);
SlideAlongSurface(Velocity * deltaTime, 1.0f, LadderNormal, Hit, true);
}
}
of course when I am playing as listen server or standalone it works properly
My gamemode spawns a bunch of actors in BeginPlay and Destroys them in EndPlay.
I'm saying that with seamless enabled, and I do ServerTravel, they are already destroyed before gamemode EndPlay is called. Not sure why that would be true.
ok I see the problem propably is getting the player local input vector and the server is not receiving the information about it
Excatly, problem solved I got the acceleration instead of LastInput vector, normalized it and I have the same effect
I'm using my playercontroller(PC) to proxy calls from client to server. However I'm running into an issue where I have run on server custom events A, B, C, but in C I also want to use A and B.
The problem is I can't call A and B from C, since I need the PC to call A,B and getplayercontroller returns the servers PC from within C.
So I'm wondering if there is an approach to this where I can have reusable functions that make use of getplayercontroller etc without having to care about whether it's already running on the server, I guess I need to have some context of which client that is invoking the RPC essentially.
What is it that you are actually trying to do, gameplay wise
You don't normally want to use get player controller
Use get controller to return the controller that the character has
So if you are inside character that is owned by player 2. Get controller will return the pc of player 2. (Only on server and player 2 machine since client only know their own pc)
Most of the uses are to call server RPCS. I'm using playercontroller since it was a fairly reliable thing that my client owned and the server rpcs needed something I owned.
A simple example would be an RPC to eat an apple, would update the inventory, fire of an RPC to send a message "bob eats an apple", and then fire another RPC to drop an apple core on the ground.
If you're running a run on server custom event then you can simply call another server custom event and it'll work because it already has authority and is the server. No need to get the client to call it again. And if you need a specific character to do something just add an input and send that character as a payload.
Maybe I'm misunderstanding the issue though.
I reread and I think I'm definitely misunderstanding. Lol
What you're saying makes sense, the problem I'm running into is the server custom event I'm trying to call from the server is on the player controller, which is where most of my server custom events are, but I cant get that.
I can pass in self to all my functions, or pass in another variable but only if its the server, but that feels a bit messy. Maybe thats the idiomatic way to do it tho?
So client 1 gets their PC and calls a client > server rpc to eat an apple. So that server event is on the player controller. Why can't you call a second event within the eat an apple function?
if the eat an apple logic was in the PC, that probably works, but the logic for eat an apple would be somewhere else, say in an inventory system class.
So once I'm in that class, I no longer have the PC, unless I store it somewhere or pass it in to that function, because getplayercontroller returns the server PC not the client PC on the server.
Hmm.
Server rpc = run it in the server machine
Yeah. I think I would just pass the character as a reference that's eating the apple. Ideally you wouldn't want to string a rabbit hole of functions like that together. Why not just call all the relevant functions from the player controller in the order you want?
So if I'm the listen server and you as the client call a server rpc.
All the codes will be executed in my machine
Calling any other function after the server rpc is just calling the function in my (server) machine.
The server hold a copy of everyone pc
So when your pc run a server rpc, it just runs the function in the player controller that the server has
Right. Which is the same controller of the same character.
You can route that to your pc. But doing it in character would make more sense
If it can be done with just a sequence, what you said could work for some cases.
The problem is more about the more general case where, If I write a function that A that calls a server RPC, I can't just use getplayercontroller and call it, I have to somehow remember that that function is using getplayercontroller and change that if i ever reuse A within another function.
ultimately it feels like I should just write my own wrapper around the controller to prevent having to think about this. But this feels wrong from a unreal mental model.
How do you route it to the PC?
For eating an apple I'd call it from your rpc on the PC. Run the "remove item from inventory" function on your inventory component (which could live on your pawn or controller). Then spawn an actor, then multicast an alert. All in the same function.
Can you give an example of a function that would do that?
By passing reference. When you commit eating the apple you would know which character eats the apple.
Character -> get controller -> I'm eating apple server rpc
Sorry. In reference to the generic function where you get a player controller.
Or just character -> eat apple server rpc. Eating is something a character would do.
Typically if it matters which player controller is needed in that function** then you should have an input for it.
I'm just using the controller since they are. But yeah. Agreed.
Yeah either one works
One thing I don't like to do is passing ownership to call rpc
So I just use components owned by the character
Or dump it in the controller
correct me if im completely just not understanding what your asking. But it kinda sounds like you are wanting to be able to call an action, but define the logic of the action elsewhere?
I think they're wanting to build a function library that relies on using 'get player controller' in many of their functions.
So for this case, get controller from the character would get me the clients controller on the server not the servers controller ?
Get controller will refer to the controller that owns the pawn
The server has a copy of all the clients controllers, and the server if it's a listen server.
Unless I am fundamentally wrong about how multiplayer works. Lol
Which is possible...
So get controller if run on server machine inside player 2 character will return the controller of player 2 character that the server has.
Get controller by player 2 inside its character will get the controller of the player 2
Kindred explained it above
This might work if I put everything in character...but that seems like I'm overloading everything there.
I haven't even started doing much mp stuff but I'm thingking of component added to the character
Any action performed by the character can go there
There is also player state, game states, etc
Really depend what you want to do
It's not like you are gonna be doing tons of rpcs. You want to replicate as minimal data as possible imo
or ahem GAS maybe? TriggerAction(Action.EatApple)>EatAppleAction
I recommend making components for your character for each feature they need. Health, combat, inventory, etc. and having a relevant rpc graph in each.
At a high level, I have a bunch of small functions that call an RPC. When I want to compse those functions in some arbitrary way, I'm finding I have to be very careful about my useage of getplayercontroller and this feels like a mental model mismatch, so I'm trying to get an understanding of an idiomatic way to have a library of small functions each making RPCS that I can reuse and chain together without worrying.
You'd be surprised. Lol. I'm working on a relatively simple game and I've already got like 30 rpcs in a week of development.
I see ok ๐ค
Yeah nothing wrong with that. I mean the only way for client to communicate with server is via server rpc
You can get a lot of mileage from an rpc using TriggerActor that passes an array of string parameters and the actor reference.
Combine it with a trigger component or an interface and you can do even more.
I see a lot of compression done by epic though, so maybe we do need to manage network bandwidth to keep the game running properly
Especially rpcs on tick
This is what I have, but it seems for things that aren't connected to a character, or where I can't just get the owner, is where I hit this issue.
But yeah. I think you should just be passing a reference to the controller you need if it's not intended to be called on the owning player controller.
You should be able to pass the character that is eating the apples , sounds like you have design issue otherwise.
Yeah. I'm not sure if there's a generic place you can do rpcs. Maybe the game mode or game state?
It is the owning player controller, which is why passing in "self" works in most cases but that part feels really silly ๐
If it's always the owning player controller being called from the character or controller you want it to trigger on then you don't need an input at all. It should just work.
Because again the server controller is the same as the client controller you called it from.
Ya, totally agree on the design issue, that's what I'm trying to figure out.
Just one has authority and one is local
I need the input to pass into the function that I'm calling from the playercontroller, not sure if that makes sense. So that that function can make an RPC.
Player interact, passing its instance (character reference ) to the object that is being interacted.
Apple run the interacted event with character ref passed as input param.
From the character -> server rpc-> eat apple.
If you need to inform server the object being eaten, add actor input to the server rpc and pass the apple.
This is basically what I'm doing to make it work, but i'm using controller instead of character. It just feels weird to have to pass character or controller around like this.
Not at all, ownership is a thing in multiplayer context
You can use component to act as a manager I believed. That's my plan for my game anyway
You can call rpc on other actors by setting ownership but that's even more ugly and open more ways for vulnerabilities
That's actually exactly what I was fixing from a tutorial to end up in the place I'm at now ๐
95% of tutorial for mp in youtube are pretty bad.
Some are just straight wrong.
You can make an rpc to any player controller at any time from any actor. Even if it's the server already. You can either check if it's had authority and skip the client call or just do it anyway.
It is miss many things and leave with more questions
Do you mean without passing in a parameter?
Yeah.
The only reason you would need a parameter is if you need to know what actor to affect with that function. So in the case of eating an apple you might want the character reference to know who's health to modify from the server.
What's an example function you're running into issues with from your game?
ya, makes sense
Or are you just trying to get ahead of the issues and haven't run into them yet?
The important thing to remember is that if your controller calls an rpc, then the server that it passes to is the same controller controlling the same character. It just now has authority to affect things because it's the server.
I'm trying to get ahead, but it came about from a simple case.
I have a chest which has an inventory. When you right click on drop I RPC call remove item from that inventory, at the end of that function I just reuse another function I had and RPC call drop item.
The problem is that the RPC call at the end doesn't have a PC to call on..
So drop item needs to know where to drop the item? Or it's returning null when trying to get the PC?
drop item is server custom event, so I need to pass in a param for target since self at this moment is not a PC.
drop item will need a way to get the controlled pawn location, right now im just using the PC for that as well, but not passing it as a param. Its just sitting in the PC for now, so I just use it as is.
so as a result of this, I'm finding I can't trust any of my functions that use getplayercontroller since if i call them on the server they will break, so thats something I need to resolve.
It just clicked. I see what you're saying. Lol
Yeah. You should only be using get player controller in local functions.
If you need to, name your functions Local_DoX so you know you can't use that in an RPC call.
Or just be sure that any time you use get player controller you think through if it needs to be done on the server and if so it needs an input for the controller.
Otherwise it'll just be using the servers local player.
Lol sorry that took so long to click. I had to step through the entire process and then I went "Ohhhhh..."
Ya, all of that makes sense and what I ended up landing on as well, but wish there was a cleaner solution.
heh, its all good. Not sure my explanation was the best
Is the blind leading the blind sometimes in here. But teaching is the best way to solidify newly gained information so I like to try to help when I can. Lol
Thanks for your help, @dark parcel you as well. I'll sleep on all of this and maybe something will click overnight.
Passing a player controller reference isn't a huge problem. It's pretty common. Keep in mind that if you're just using get player controller to call a generic RPC that doesn't rely on a specific character, then you don't need a specific controller. Like triggering a door to open. That can happen on any actor with authority so any PC will work. So if that's the majority of your get player controller use cases then I would just fix the problem children as you come across them.
Typos*
That is my case for a lot of stuff, but I found i had to set owner on things to make RPCs so that became a race condition between the setowner RPC and then the subsequent open door RPC.
but maybe I wasn't quite doing what you are suggesting
Huh. Can't say I've ever set owner on anything.. but race conditions are very common in multiplayer. Especially when you're performing quick actions in succession. Like multicasting a sound effect then destroying an actor. It'll work on the server but the clients likely won't receive the event before the actor is destroyed. Really annoying stuff.
Aight, well I'm headed out, thanks again, take care.
Sup guys
I'm trying to work on a """match making simulation""". Currently players can create a lobby, where they can invite friends from Steam. But my idea is, when they play, they will look in the list and try to find another server that they can join, if it exists, they will join, otherwise they will travel with their current one and it will become public (becoming a possible session to join)
The problem is that when I use find advanced session, I don't want them to find the server itself, so I created all this logic:
https://blueprintue.com/blueprint/nctlq5h7/
but I'm failing in how to compare their current session and the others, which were found in find advanced session
what is wrong about it
I try to give costumes to all of my players randomly
Btw I trigger assign costumes after beginplay
For a dedicated server game mode, is it best to handle player spawning logic in PostLogin or HandleStartingNewPlayer?
I'm leaning towards PostLogin, because I need to do some DB calls via rest api.
Hi,
Can point me in the right direction how to find out, if an object is relevant for replication?
For example if the players are far away from an object that fires an RepNotify they will only get this notify, when they are close.
I would love to know how they do it internally and how i can maybe use this to make my own optimizations.
Thanks in advance ๐
In short, it's evaluated by the Server every replication frame by checking the distance between the players view location and the actor location. That's about it.
Gotta love that old unreal cruft.
Many people don't even know that view location is sent to server.
Yeah, which is hilariously exploitable in itself 
Wanna see whats happening on the other side of the map? Mmmk just spoof that location to the server, ez.
Btw been spamming HLL, love it. Although I gotta ask how so many people were involved. It's got a ton of art but it doesn't seem like the systems are that crazy. Has it just changed hands a lot?
Also I've never squinted so much in my life, just shooting at bushes half the time.
lol, well the core team at any given time was like 15-20 people tops I think, it has a colurful dev history
Is it possible to go into the connecting players controller and grab a variable from their game instance?
You have to call a client RPC that will get it and then do a server RPC to tell the server.
Is there an explicit way to call an event or function on the client? Also, how exactly will the client side RPC tell the server? Sorry if the question seems a bit silly. I'm not too familiar with RPC's and the documentation is a bit lacking on their usage with blueprints.
RPCs are extremely fundamental to networking. Should definitely have a handle on them. I just told you how to do what you wanted. The docs for RPCs are pretty good honestly. It is extremely straight forward. And you should also go through cedric's multiplayer compendium that is a pinned post.
You may need to just go through the motions of creating and calling RPCs before they sink in.
Right on, thank you so much! I feel I haven't really done them, thus they haven't sunk in. I'll get on it now and checkout Cedric's compendium.
Hello I created a map and downloaded fps starter kit to setup a team death match but when I try to open the level in the fps starter kit the map doesn't show up
I tried to copy and paste the folder but no luck
When I try to open the basic map in fps starter kit unreal engine crashes
Do you know the best solution?
Even though I'm new to this discord, but i think you could give more clues to help us. Exactly what FPS starter kit did you download? What version of unrean engine are you using? What did the Engine say in the Crash window?
I downloaded fps started kit from the market place to play team death match on my created map
I'm using the latest version 5.4.2
It says send and restart ue has crashed
Did you buy this?
https://www.unrealengine.com/marketplace/en-US/product/fps-starter-kit?sessionInvalidated=true
If so, the creator has his own Discord server. It's in the description. I would recommend that you contact him first. If a certain piece of code crashes, the creator will be better able to help. This is not enough: "It says that sending and restarting ue crashed".
You need the exact text of the crash that it says.
And probably to install the debug symbols from the launcher too.
lol, I know ๐ฆ Next time you're around I'd like to hear more about your door example.
what is wrong about it
I try to give costumes to all of my players randomly
Btw I trigger assign costumes after beginplay
You're removing items from the array that you're currently looping through which changes how the loop behaves. It seems like you may want to use a For Each Loop with Break to stop looping once you've found a costume you want to use.
Also seems a bit odd to have this on an RPC. This will allow clients to call this RPC at any time.
Hey, so weird question: I have a replicated actor, owned by the server.
I want to disable replication and destroy it on the server, but leave the client's version intact, (but not replicated). I am using C++
Any tips would be appreciated
Only hint in there is that there's something looping through some child widgets but the parent widget is being destroyed while doing so.
I'd probably look at TearOff first
Taking a look
Hmm I'm not sure datura,
It's still destroying on both the server and client. Could this be because I am destroying the actor immediately after calling TearOff() and it hasn't updated the necessary network info? I may just need to call Destroy at a different time
I try to learn rpc. main issue is rpc. can U help me
I think this is a dumb question, but does anyone know if the PktLag setting for emulating poor network conditions is roundtrip or 1-sided? Like if I do PktLag = 200 should I expect a ping of 200 or a ping of 400?
Are there any resources for using streams in a replicated setting?
I'm hoping to generate some random values between a range, with the Min / Max being set with OnRep'd variables, and it'd be nice to only have to replicate the range and esnure that the randomly generated variables are the same ๐ค
You need a seed of some kind. Either with the min max, or generated in some other way that is always the same on each machine, like location, etc.
But if I obtain that seed and everyone shares it, when you run the random float, how does it determine the random number? Is it based on game time or something?
You create a Stream out of the Seed. Then you use that stream to randomize between the minmax. Using the same seed and min and max, it will always return the same value.
the function should probably be on the server, not in an RPC
Stop pulling stuff from your ass ๐คฃ
It's okay to not know what you don't know
shhh
Doing otherwise just make you a bozo
it should be called from the server, and the server only, ofc I know
And harm other people
you just mad at me
RPC is literary a function
Go look up rpc
@dark parcel you know cat doesnt look things up xD
It can happend on server, all client or client. Also it doesn't help what you said earlier being wrong.
Normally: Clicked -> RPC -> Checks ->ย RemoveItem or wtv
Yea I don't normally care but I keep seeing him mislead others
Saying it with confident too
oh I totally get it
what I said is right
I've got a fun multiplayer one that hopefully someone has handled before. Starting a session and listening for a connection on a listenserver machine, then joining that session with a client works fine. I added a button to allow the listenserver to stop waiting for a connection by calling destroy session and it should be working. The issue is if I start the join on one machine, then cancel with the destroy session on the other. after a few seconds the client finds the session still and gets "stuck" trying to talk to it. Eventually over steam it times out and I get a Connection timeout error on the client (but this doesnt happen in PIE which is a pain). Soo.. ok not a biggie but once the client times out it reloads back to the first map of the game (my splashscreen) which is rude user experience. Is there a better way to stop the client from joining a dead session so this doesnt happen, or a way to override the engine from defaulting back to the splashscreen map?
based on call order
you set the stream up, then every time you call it in sequence you get the same sequence of "random" numbers back
Are there any good hands on video series for multiplayer in 5.0+? Building a game with an authoritative server from the ground up; preferably that doesn't have any project files you need to download to follow along.
Joining a dead session. No not really. The main issue there is Steam. Sessions are only periodically updated. So you're at their mercy there.
About returning to the main screen, that is normal for a lot of reasons. Console TRCs specially. But there is an override that lets you not do the OpenLevel call on a disconnect. But I'm uncertain how that works in the middle of a connection or if it even does at that point.
https://www.youtube.com/watch?v=JOJP0CvpB8w it's an older video using UE4 but its the same stuff.
@kindred widgetany idea where the override is at?
Hi people! Who has encountered such a warning? LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: StaticMeshComponent /Game/Maps/Server/startMap/startMap.startMap:PersistentLevel.BP_playerCharacter_C_2147482408.StaticMeshComponent_2147482402 NOT Supported.
but in UE5.3 not this problem
i`m use 5.4.2 and off the replicate and warning is not see
I just stumbled onto one of this guys videos, was cool. Is this part of a bigger playlist? Do you know of any that have you make an entire game(simple on)?
Oh I see - I had assumed it would take into account the game time or something like that. Interesting that this is not the case. I suppose I could get the game time from somewhere and use that for the seed - the game time should be synced, right? ๐ค
Depends on how accurate you need it to be. Lag always plays a part. GameState has a somewhat synced time.
Hello, I have a question that I cannot solve. I'm working on a game similar to Dayz. However, due to my design, I want to host around 500 players on the same server. Interaction between players will be quite low due to the distance. I hope I can achieve this using Relevancy. Since players are scattered around the map, they rarely interact with each other and are mostly busy with PVE content. Has anyone had similar experiences with stock UE netcode at this point? You can think of this question as a thought experiment and express your opinion.
call order, meaning?
Like, if I have the seed, and I call random float 3 times using the same seed, I should get the same number back each time right?
Or is stream different, in the sense that it provides a preset list of numbers based on a seed, and you iterate through whenever its called?
If so, that could be problematic if not all calls are RPC'd and such, hmm
No not really, I'm sure there must be plenty out there but I think if you start following a tutorial to make a game then you'll likely end up making the same game as everyone else who followed that same tutorial. It's better to make something unique instead in my opinion.
When you make a call to a stream it's shifting what the next value to be generated will be. If you reinitialize the stream each time with the same seed, then yes, it would be the same number output each time.
Do you guys prefer to use seamless or non-seamless travel for multiplayer?
Arguably, non-seamless is "cleaner" in terms of resetting everything.
I'm using dedicated servers
For example with seamless, you don't have the endplay-beginplay cycle for controllers
If you were to do something like this on your end the print string should come out to something like 12.080474 for the first print and 9.630316. If I were to reset the seed on the stream again, you can print out that same series of numbers again. What matters is the order in which things are called from the stream. So in the second example, I've reset the stream again, and this time I requested a random bool from the stream which returns as a "false" printed, and then I get the same 9.630316 printed out from before.
Interesting, so in a multiplayer game, there could be relevancy issues depending on if a client calling that random value is not relevant to another at the time
Yes absolutely.
Are there other solutions for synchronizing this? For instance, couldn't I use something like the game time to set the seed?
I assume game time is synched across all clients and such in terms of 'when things happen'
though, I guess not, now that I think about it
because of time delays of actually sending messages
Hmm
Seed doesn't really have anything to do with it. The seed and stream is just setting what what potential sequence of values can be as they are called from the Stream. if you don't call things in the same order, then it can't be synchronized. You can replicate the seed, but then you have to make sure that the client does the exact same generation from that stream.
Things are all reset with Seamless too. The only difference is that it is transitioned differently. You are still given a different controller, playerstate, there's a new game mode and game state, and the old world is all destroyed.
@gritty warrenBut what is this for in general? Cause there's probably an easy answer here. Hard to help without knowing intended functionality.
Certain actors persist across seamless travel.
See https://dev.epicgames.com/documentation/en-us/unreal-engine/travelling-in-multiplayer-in-unreal-engine?application_version=5.3
An overview of how travelling works in multiplayer.
still can't seem to get this OnComponentBeginOverlap to work. Collision box creation / attach to rootcomponent, and OnComponentBeginOverlap.IsAlreadyBound all return success on the server but it still only fires on client
I have procedural recoil, and to do so I'm actually generating a random float to shift the gun via control rig. The recoil matters because my bullets leave the barrel of the guns realistically, and that direction determines what gets hit. It isn't completely necessary, but it'd be really nice if the recoil was synchronized to some degree.
I really don't want to have to replicate the actual recoil values I'm generating, but I suppose its not the end of the world if I do. ๐ค
right, there doesn't appear to be a 'get random float' with a seed, only one with a stream, hmm.
ye, but it'd be ideal to skip the stream part
Why for?
well actually I'm not sure how this works so maybe it wouldn't be, but in my head I would just sync the random values with the game time via the seed. I guess maybe it doesn't matter if the stream is there in the middle? Idk tbh ๐ญ
The stream part is the whole idea of using a seed.
You generate numbers from the stream which is set by the seed.
You generate in a specific sequence. This is useful for procedural generation.
Each time you fire your gun, you can just randomly generate a new seed (not from a stream) and replicate that and then initialize your stream with that seed and generate from it. You can use the stream to generate the values that the rest of the generation needs to use as well.
I'll be going through it anyway, but is the pinned Multiplayer Network Compendium a good place to find an in-depth look at the flow of player login and spawning of pawns. I'm running into a lot of gotchas in a row, and would like to actually get a good understanding of what happens.
Yes, but imagine this:
Player 1 ------- Player 2 ------ Player 3
Player 1 and 3 is relevant to Player 2, but Player 1 and Player 3 are not relevant to eachother
All 3 are calling from the same stream at T = 0, and lets even assume 0 latency.
The streams would get desynced, no?
Ah, wait, I see, they actually can all have their own stream huh
Yes.
If you're replicating the seed and creating a stream from when the gun is fired, each player would generate their own stream based on that seed.
That makes sense. So whenever you 'press the trigger', you replicate just the seed, and that instance of autofire will be synced
Smart
This is why I appreciate unreal source and all the kind folks in it like you
It probably doesnt
thank you so much for this!!!
Its more focused on the fundamentals of networking itself
RPCs
Replication
The relevance to the network that each Actor has
Etc etc
The best thing to do is look at the Source Code
Starting in AGameModeBase::PreLogin
One last question - if the streams can be unique, the only reason you would want to replicate it each time you fire is because of relevancy issues, is that right?
Like if everything was relevant all the time no matter what, you'd only need to generate it once per player and it would be fine, right? ๐ค
No. You want to replicate the seed to use for the generation so everyone is on the same page. Each fired bullet gets a new seed. The seed gets replicated. The clients create a stream with the seed. Everyone will then generate the same values from the stream.
each bullet gets a new seed? You mean each instance of gameplay ability that fires a single bullet or many bullets, right?
Because if each bullet gets a new seed, I could just replicate the recoil values itself me thinks
I guess replicating a single int is cheaper
If you're doing a procedural recoil, then you'd probably want to replicate the seed for each bullet as that ensures that even those that do show up late to the party will be producing the correct visuals --- say for example you had a gatling gun that was just continually firing and you decided to use a single stream to generate all the recoil from it. If the person firing the gun was maintaining it for dozens of seconds, and someone joins 10 seconds into that firing - they would be generating from the initial seed which means they would be out of sync. Replicating the seed for each bullet fired allows you to procedurally generate on clients specifically for that shot and without having to send all the values. If you want to maybe restrict how much data is being sent for automatic weapons, as a gatling gun could be a little on the extreme end, then maybe set a new seed every second or two while firing instead.
Ah, great example of why my logic would lead to issues down the line
Awesome, very well explained! Thank you so much!
when i click a static mesh and attack my character run only to one point
he goes around the mesh and attack on other side
why he dont attack on the point on the shortest way? o.O
quick question...i follow a project called City of Titans...an aspiring hero-themed MMO that started back in 2013. Its an indie team, part-time and unpaid volunteers. What they've released to backers so far is a lackluster character creator and the first pass at their launch map...but its a skeleton map; nothing to actually 'do' in it. Also, some stand-in combat powers with set damage and basic animations that i'm sure were all created in a day. My question, thanks for sticking with me through the context, is this: they just mentioned today that their next project is multiplayer...give the context and knowing it's likely a single, part-time, unpaid volunteer dev working on getting multiplayer setup...what is a realistic amount of time it may take him/her?
Sounds like the project is already doomed to fail and is another โgive me money so I can make something that isnโt in scopeโ
This is a second project they are making in addition to this mmo?
sorry, I was unclear. its not a new project...its the next 'task' on this devs list is to start tackling multiplayer. just the one game
Is there any weirdness or funkyness with subsystems and multiplayer? I essentially have an asset subsystem that loads the assets upon the world calling beginplay, my issue is that I cant seem to breakpoint that beginplay ever being called for my subsystem if I run the game as a single client only... I really dont understand
Oh I see ok thatโs a little better XD
It really depends on how much experience this person has. Multiplayer itself is a pretty big box, an mmo backend is even more so
As you are now dealing with multiple servers, scaling, authentication ext
no experience creating mmos, i'm pretty sure of that. none of them were former game devs
Then it probably wonโt launch unfortunately
Unless they get serious funding and hire a few backend engineers
this sounds like a prototype in a week with some pre-made assets. If it took them 10 years, then it'll take 100 years to add multiplayer
Humble opinion, getting two game clients to talk to each other about something is a drop in the bucket compared to a backend infrastructure
Itโs expensive, and there are a lot of factors
And maybe they really have a dream. Thatโs awesome, but I would take a serious look at the number of โI wanna make an mmo projectsโ and the graveyards they left behind
Even ones that managed to get millions in funding only to be completely shut down 5 years later
Still trying to wrap my head around doing replication properly. Here's the scenario I have
Actor has an ActorComponent
ActorComponent has a replicated UObject property
Replicated UObject has a replicated FInstancedStructContainer
From log messages I can see that the UObject property is getting it's RepNotify called.
But the FInstancedStructContainer is not getting it's RepNotify called.
Hence, the UObject is replicating, but not completely.
Am I correct in believing that this is expected behavior and that if I want the FInstancedStructContainer to replicate is needs to be directly part of an Actor or ActorComponent?
FInstancedStructContainer is likely to not support replication.
Does a TArray<FInstancedStruct> property replicate instead?
Hmm I haven't tried an array. I may have to at this point
Yeah FInstancedStructContainer doesnt support net serialization
OK then, well I know what I'm doing next then. ๐
But what about it being in a UObject versus directly on my Actor Component? Should that make a difference?
Sounds like you have properly setup the UObject to be replicated
So that should theoretically be ok
Well thank Heaven for small favors. then
When I started I had multiple layers of nested uobjects and didn't realize that would be a problem
Besides technically being setup correct to replicate subobjects, you should ask yourself if the instanced struct being replicated belongs on a UObject or just directly on the component, we don't have your use case or code
I really need it on the uobject since that object can be stored and accessed even when the actor and actorcomponent it belongs to is not instantiated in the level. This UObject defines the properties of an item that can be added to an inventory
Well that sounds perfectly valid then ๐๐ผ
OMG it's working finally. I shall sacrifice many RAMs to the goddess Ada Lovelace in your name @fossil spoke ! Thank you!
I have been beating my head against this wall for a month or more.
At the very least, my efforts have produced a cleaner and less complex design than I originally started with
what about your design?
I eliminated some classes that didn't really serve a good purpose so the class hierarchy is smaller now
you design one inventory, you want loading item from server in one list/set/array of items to client and trouble with properties of items?
I don't understand what you are asking
what ever, I think I understood your design approach, don't mind
Awesome ๐
Can someone tell me if its fine to FORCEINLINE onrep's and keep them in .h?
UFUNCTION() FORCEINLINE void OnRep_bFiring(){}
UFUNCTION() FORCEINLINE void OnRep_bCrouching(){}
They are function like any other so inlining them is possible.
However you probably dont want to.
Most of the time the Compiler is going to be better than you at determining inline usage
It will do it automatically without you forcing it
Thanks, so i will keep them in .h without FORCEINLINE
๐
visibility reply...
fixed
Post what you did to help future people who search and find this
you modify the name of event "event" into "Event" for both nodes, what happen?, if it work or not?
Hey there!
I've been doing a re-read of networking articles/posts made by Vori, more specifically, atomic replication (https://vorixo.github.io/devtricks/atomicity/).
It's discussed that with non-atomic structs, there is a possibility of achieving such a state on client-side that never existed on the server, such as when you're updating a struct's different members on separate frames as they'll end up in different packets. So far so good.
So when a packet gets dropped, e.g. we had 2 bools in the struct, A and B. Both were false, and we just changed A to true, then couple of frames later, B to true, then we'd have 2 packets with the 2 deltas (change A from false -> true, and change B from false -> true). So if packet 1 gets dropped, then our struct will look like this: A = false; B = true. (this is why we have atomic rep).
But anyways, replication ensures that the client's version of the variable will eventually line up with the servers. So packet 1 has to be resent at some point. So later both A and B would be true.
What happens if we modify A again on server-side, and set it back to false? Is there some mechanism preventing us from updating bool A on client side in such a way that we get packet 3 (set A back to false), and then get packet 1 (set A back to true)? The last state it's on the server is false, so that's should be our last update right?
I'm not sure i was clear enough on this ๐
i have a projectile homing ... and event on component hit(sphere) it should hit my character... but the sphere overlap him
i have all set to block -.-
Check your collision setting on both the sphere and the character
Hey I'm super stuck on something I can't figure out for the life of me. I'm using Advanced Steam Sessions for my lobby hosting. If I'm in editor, on the netmode server machine if I host a lobby then any connecting clients connect to the lobby, but the player never spawns in it's just a camera looking into the lobby at the spawn point. If I host a lobby from the netmode client from the editor, my game works flawlessly. Does anyone have any idea that could lead me? I put some breakpoints and I'm finding the player controller is null, it gets all the way to BeginPlay, but then it just stops calling anything...
Also in shipping builds it does the one where it doesn't spawn anyone in all it is is the camera. That's why this is killing me. I can't get a shipping build that works the only way my online is connecting properly is if I'm in editor in netmode client screens
Wowwwwwwwwwwwwwwwwwww
I been stuck on this for a week after I post this I ask myself what if I just request a respawn at PostLogin in the GameMode like I killed them and it fixed it
why did I not do that sooner
Well it got the player in the game, but the lobby doesn't start when it fills up. Doesn't count the player coming in even tho it calls PostLogin with valid everything
zzzzzzz multiplayer is stupid
Calling server travel with a button calls the function but it doesn't travel either. What is happening
If the changes are โreliableโ, then the packet after the lost packet wonโt be processed until the missing packet comes back (via requests for another copy).
If it is not reliable, and it arrives out of order, my understanding is it will be dropped because a newer packets has arrived.
Cool
I will give random costumes (skeletal mesh) to everyone in the game and I want these skeletal meshes to have names, for example, the name of the yellow costume will be yellow and when other players look at that person, the nametag will appear and it will say yellow. how can I do it?
That's pretty basic thing to do, server can assign the random mesh and if the component is replicated, the client will eventually see the costume that the server sets.
If you don't know how to do a one liner like that, you should read the compendium written in this channel.
@shrewd ginkgo
can U help me about it? how should I replicate it
I've already explained above
Also you are only setting the skeletal mesh on server
You should use on rep variable for the client to set the skeletal mesh
when i spawn homing projectiles they move the same way
how can i make each homing projectile move other way to target
that it looks better
Sup guys!
I'm trying to work on a """match making simulation""". Currently players can create a lobby, where they can invite friends from Steam
But my idea is, when they play, they will look in the list and try to find another server that they can join, if it exists, they will join, otherwise they will travel with their current one and it will become public (becoming a possible session to join)
The problem is that when I use find advanced session, I don't want them to find the own server, so I created all this logic:
https://blueprintue.com/blueprint/nctlq5h7/
but I'm failing in how to compare their current session and the others, which were found in find advanced session
Does anyone have any idea how I can solve it or a way to do it differently?
If I execute server rpc from the listen server it will execute, right?
Correct
Why aren't the events in my Game Mode being triggered? When I leave the lobby and travel to the game map via ServerTravel, the Game Mode GM_Game associated with this map should trigger events (checked with a Print). Why does it seem like the Game Mode isn't instantiated?
Hi,
Are there any events i could bind to when the NetCullDistance is out of range and an actor becomes irrelevant to all players?
Im trying to optimize replicated physics items and want to turn off everything when its out of range, without adding new distance checks, since they are kinda expensive.
Is it possible/would be fine to create session from the player that will be the listen server, resolve the connection string from the listen server and pass it to other players via the custom backend to let other players in lobby to browse to that connection string without actually joining to the session?
Only reason I'm using the session here to get a connection string because I believe using the raw ip would create problems due to NAT? Is it a conflicting state to use a custom backend for lobby/group creation and matchmaking with listen server configuration?
Why are you avoiding the sessions specifically?
Maybe due to me not understanding it correctly, but our end goal is to make cross platform available between consoles and PC. If we are going to use sessions then EOS+ is required. And in order to link steam accounts with eos accounts, some kind of authorization is required by the user to allow epic save their information (?) and it's a pop up appears in the game, so it can't happen under the hood(?). Both this and EOS still being beta made us from getting distant from sessions and try a third party backend service (currently testing Nakama). Everything is okay with friends, steam authentication, creating parties and matchmaking. But the part that we're not hosting dedicated servers and players need to pass their IP over the lobby is where I'm stuck. I'm not sure if our plan is doable or not to be honest
When I start my level then in the player on the listen server I can activate an item to change a condition setting on it, then pick it up, drop it on the ground again, and activate a second time with no problem.
But in a second player on a client, if I try to do the same thing, then I cannot activate the item a second time after picking it up and dropping it. I get the error "LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_Box_C_1. Function Server_SetIntByTag will not be processed."
Why does my spawned actor have no owning connection when activated from a client, but it works fine when activated from a player on the listen server? If it makes a difference, the condition variable being changed is stored in a replicated TArray
The code to spawn the actor is this, and it runs in a server side RPC
if (bSpawnActor)
{
UDcsContainmentFragment const * InvItemContFrag = Cast<UDcsContainmentFragment>(InvItem->FindFragmentByClass(UDcsContainmentFragment::StaticClass()));
FActorSpawnParameters SpawnParams;
SpawnParams.SpawnCollisionHandlingOverride = CollisionHandling;
AActor const * NewActor = GetWorld()->SpawnActor(InvItemContFrag->ActorClass, &Transform, SpawnParams);
NewActor->FindComponentByClass<UDcsItemComponent>()->InvItem = InvItem;
if (InvItemContFrag->bIsContainer)
{
UDcsInventoryComponent* InvComp = NewActor->FindComponentByClass<UDcsInventoryComponent>();
InvComp->RestoreInventory(InvItem->StoredInventory);
NewActor->FindComponentByClass<UDcsItemComponent>()->InvItem->InvComp = InvComp;
}
}```
I can't get my head around what exactly are sessions and how they work. Like why do I need a session (or do I even need one) to be able to create a connection string, would I not be able to use the steam socket to let players with different native oss join them, how does EOS provides that functionality if I can't. I have some missing concept understanding but I don't know what exactly
What do you mean by "activating" an item? Your problem seems like you lack ownership to call an RPC. I would recommend setting the owner of the item actor as the player that is adding the item to their inventory, whether it's server or not, and setting it back to null after dropping it. That way you can call RPCs from clients that have the item on their inventory
Regarding replicated properties and RPCs on a game state, is it possible for an RPC to reach a client before replicated properties are replicated upon connecting to a server?
You misunderstand. The actor is not in a player's inventory when it is dropped on the ground, so it would be inappropriate to be owned by any player. (And when it's in an inventory, it is not an Actor anymore, it's just a UObject that stores the item's identifying data.)
By "activate" I mean I have an interaction option on the item that can change it's state without picking it up. In particular it changes the value of an int variable stored as part of the item state.
Epic's EOS is widely used :P
Regarding your Session question:
A Session is just a bundle of Information on the Backend.
What it keeps track of is mostly up to the Service behind it.
Usually it's like who's in the session. But also additional settings like what GameMode or Map can be put into it.
That then can be querried and displayed. In that way it's mostly used for Server Lists.
But even without displaying them it's reasonable to keep track of GameSessions and PlayerSessions with this.
EOS is used by Epic and a lot of other parties. You don't need Steam for it, but if your Players are buying the Game on Steam, then it's def good to use the Steam Account to auth the EAS with.
And then the Consoles would do their own.
With EOS being a thing, I would probably not try to create my own backend. Just too much work.
I'm watching a video, learning more about replication from C++ and such : https://www.youtube.com/watch?v=NWAdK2ndYWc&list=PL22CMuqloY0op5-U6YBrdyczB1je8B1ie&index=1
It's discussing 'the new fast push model', and I'm wondering if this information really is quality info. Is usage of the pushmodel something that I shouhld learn, and ignore old ways, or are there circumstances where you would not use the push model?
im doing eos subsytem and when im joining a session i get thisL
LogEOSSDK: Error: LogEOSLobby: Invalid parameter EOS_Lobby_CopyLobbyDetailsHandleOptions.LocalUserId reason: is not a valid Product User ID, Result: EOS_InvalidUser
i found its a bug in ue5.3 but im on ue5.4
any help
i have a huge problem
projectiles replicate is easy
but how can i replicate homing projectiles ?
i find nothing in internet -.-
can someone tell me how to replicate homing projectiles?
huge problem? would hate to see a small problem lol
when you spawn then projectile, you make sure you set the homing target, thats it
when you spawn then projectile, you make sure you set the homing target, thats it
Has anyone ever seen / heard about an issue where on a dedicated client / server connection, the joining client gets a black screen in world partitioned levels? It's fine in all maps that are not "open world"
the black screen goes away as soon as the client presses any input. if he doesn't click any input within 60 seconds he gets a timeout.
i've disabled streaming for testing, but didn't help. i can see the client spawning in another client (so the server pawn is active and ready)
@gray sparrow in our projectile class, we have a function "SetHomingTargetActor"
this is called on server, and sets a replicated property "HomingTargetActor", this property is Replicated Notify. In the OnRep_HomingTargetActor, we set the projectile movement components homing taget component to the actors capsule.
i try mom
i spawn the projectile on server
that spawn actor and set the homing target it didnt work
did i somethign wrong? o.O
set the target on the server perhaps?
and make sure the target is also replicated
unless you're just running the motion logic on server
i read that the velocity of projectile is not replciated
the target change every time...
every frame they msut update where the target is...
i spwan the projectile on my character
i have to set the homing on my character
or can i set the homing in projectile bp?
i spawn it on the server
its a child but the event fire on server
actor target is replciated
and set the actor target as homing target
it didnt work
that server event doesn't appear to be replicated
it sis a child bluepirnt
the event is from parent
in parent its on server
how should the client know where the target acutal is?
is "actor target" replicated on Homingprojectile 3?
yes
fire them at slightly different initial directions
same start direction + same target location = same path
different start direction + same target location = different path
Does anyone know if you try multiplayer in PIE if there's only one game instance, or if there's a separate one for every client?
There should be a separate one for each client. And the server if isn't not a listen server.
That migth change if you do "run under 1 process"
You never wanna have that turned on.
I asked a couple hours ago but in the case of the GameState, it's possible for an RPC to reach the client before a property get's replicated when the client connects to a server, right? As in there's no guarantee of the order they will be 'networked' in?
I swear I heard once that all the properties of an object will be replicated before its beginplay is triggered. So you could maybe delay the rpc response until begin play if it hasn't already been triggered.
Though that doesn't guarantee that other objects pointed to will have been replicated.
But that might be entirely wrong.
Hmhm it could have been that actually.
I had a case where a replicated ~~UObject* ~~ AActor*member property was nullptr on the client at the time of running a NetMulticast, but that property was valid on the server.
Err not UObject
Yeah, pointers to other objects are like entirely random.
Only game state is the first object to be guaranteed to be replicated, I think. Everything else is "random".
What you can do is use an OnRep for that actor property and wait for that before actioning the rpc on the client (store the rpc for later response)
Or use the beginplay of the actor in question to trigger potential callbacks.
"Am I property X on any other actor? Let's broadcast something!"
Maybe a subsystem that can handle beginplay subscription services!
Hm, would OnRep work here though? The property may have been replicated but the object it's supposed to point to may not have been replicated yet.
Essentially what I'm thinking happened is:
- Client connects
- Game State is the first thing to get initialized and has it's properties replicated/updated to match server
- A Game State RPC was waiting so it runs the RPC
- Game State is up to date but the rest of the world isn't (on Client)
- Crash bandicoot.
Yeah.
That's why I suggest a beginplay subscription service. Not really extensible, but yeah.
Have you object with the property register a callback with the service for when something begins play (with optional type filter?) and have any possible actor which could fit it trigger that callback with the service when it begins play.
Hmhm. It seems odd to me to for UE to allow any RPC"s to run before it's finished replicating everything.
Connecting sucks ๐
Hello, sorry to interupt, but I was wondering if anybody had resources that clearly map out all the different replication related things with examples in UE5.
For instance, I have seen a great number of videos that talk about what an RPC is and how to run an event from a client to the server, which then gets multicasted. But I have not found one that shows this in both blueprints + C++, or accounts for client prediction, etc.
I've seen some videos talking about the 'new' push model, and I'm not sure if that's something that I should be concerning myself with at this time.
My task is to just set some variables that get replicated (in this case, the value of a lean angle, so my animation can be replicated across all clients) and I am having a heck of a time figuring out what the best option is. I recognize I can set on client + call server function, then multicast and skip the owner / autonomous proxy., but is that the best way? It's super unclear to me
If all you're trying to do is replicate an angle, I'd be hard pressed to see any value in anything beyond just a replicated property
Check Cedric's multiplayer compendium in the pinned messages, great resource for Multiplayer and has examples of both BP and c++
How does it eventually update the pointer though? As I see it, the server already replicated it and unless it changes again, it doesn't care about trying to replicate it the client.
Unless it initializes all objects first, then goes through and replicates their properties, but since the object now exists on the client, it lets RPC's run? 
I mean you can probably just use a RepNotify variable, which is a replicated variables that gets a function tied to it each time the value replicates on clients. This is better than a multicast because if a new client joins, they will automatically get that function called with the most recent (hopefully) variable value
Okay, I thought I did take a look and it seemed like it wasn't very clear (e.g., I didn't see anything about Push Model, Iris, Replication Graph, etc., so what would I be msising by reading this only?) but I will take a look again and see if all that stuff is there
that makes sense, I'd still need an RPC to set it on the server though, is that right?
You don't need any of that for simple value replication
Also, if you use a repnotify, wouldn't it go back to the client and update the value?
Well that's all I'm doing now, but in the future I imagine I'll need more. Hence why it'd be nice just to see all of what is available
Not necessarily, RPCs and replication are strong enough to make an entire game out of
What do you mean exactly?
the function will be called meaning a new value is present
the variable value will already contain that value
gotcha. So how does RepNotify work in the case of client prediction?
Suppose I am rapidly changing values, and I have a very long server time for whatever reason.
I do ServerSetValue(1) then ServerSetValue(2) then ServerSetValue(3), so on and so forth, and the server function simply sets the value of the RepNotify'd variable
If I try to do client prediction, where I set it on the client and then also call the server value, wouldn't the repnotify go back to the client and then overwrite whatever new value it was, causing a delay?
if this is mostly a cosmetic variable that you want to replicate to other clients so you can animate them, I would use a replicated variable with COND_SimulatedOnly and an unreliable server RPC to update the value on the server. so when you adjust your aim you directly set this value for yourself (so you dont have any network lag) then call the RPC so it is updated on other clients
so in this case you wouldn't use a repnotify?
I dont see why you would need it
See this is also part of the trouble, because other sources I've seen say you should move away from RPCs and use RepNotifies and other stuff like that as often as possible
No idea who to believe lol
you mostly need to understand what they do then you will figure out when to use each of them
replication only works from server to client, so you can't update a value from the client without a RPC
right but why multicast back to clients instead of setting the variable to replicate via repnotify?
I've got something that has me flummoxed. I have replicated Units that also hold a reference to a tile that they're on (in case they're being moved during a phase change etc.). It was initially not working until I replicated not just the tile reference but the actor itself. This has fixed the units missing tile information on clients but now, inexplicably, the middle tile of the bench is misplaced
Expected behavior is in the first image, that is the behavior I get when launching in Listen Server mode with one player OR the behavior I get when I launch with two players for the first time. On subsequent launches of any configuration, the tile behaves as in the second image
The function used to build the board is attached, and four of those are run in a BP_Grid actor and then added to a BP_Board to build the board pictured. Then a BP_Board is dragged onto the level such that the level outline for a player looks as attached. All of the Tile, Grid and Board actors marked to replicate
I just don't get it
Getting this error when trying to build Development Server.
Development Editor works fine.
When i try build Development Client i get and error The system cannot find the file specified.
We don't know what your usecase is exactly, I suggested a RepNotify because I thought you needed a "status" value replication and a multicast isn't best for that
Each thing is useful in its respective usecase
I definitely agree here though, from what I've read this seems best
but that goes back to my original question, it'd be awesome to have a resource that shows all the different use cases and such
But then back to my concern, how to use rep notify with client side prediction?
lol
Maybe if I rewrite my question it can somehow be more clear
Hmm
I suggest writing what you want to achieve
why do you need client prediction for example
if it's actually valuable to what players will see or not
I did here, what do you find to be unclear about it?
when I press the 'Lean' button, I don't want to wait for the server to validate it.
Right, which goes back to my question of "If the variable is replicated with repnotify, will the repnotify go back and overwrite the clientside variable?"
He answered it quite nicely here
I feel like I'm talking in a loop haha
why do you want to multicast? why do you want to use a repnotify? I suggested the simplest approach
This is confusion imo.
And multicast is not to be used for anything that needs to be in sync
I see, so it's different than what you said and what other sources say
Do on client. Send RPC to server indicating you're doing it.
If the server is ok with the client leaning, set an OnRep variable marked with condition Skip_Owner to then have all other clients have the actor lean.
In the case the server doesn't want to allow the client to lean, you send the client an RPC to reset themselves.
I thought you were doing a state change tbh when I suggested RepNotify
this is also what I've read, but is different than what other people are saying here lol
I feel like you are not understanding the concept tbh
it is a state change
probably true!
fwiw I think you are confusing the terms. repnotify is a function that is called AFTER the variable is replicated, it has no relation with the value being replicated at all. you only need to use it if you want to run some logic as a result of the value changing
I didn't realize there was an option to skip owner on the variable, I didn't see that in the details panel but will look again, that seems like it'd fix it all
If you have some money to spare, there is tutorial that goes to implement client prediction and server rewind
I think what he's mostly interesting in is replicating a value to other clients only without the server trying to override the source client value
Which is what SimulatedOnly should do
SKIP_OWNER
possibly, in the detail for the variable, in replication there is a drop down with 'rep notify' as an option, so im not sure what to call that
thatd be great, which one?
Repnotify is just a function that gets called when the value is updated (on client for cpp)
Udemy Stephen ulbardi multiplayer fps one
I basically just explained what client prediction is.
Do on client, tell server you're doing it.
If server is ok with it, set a replicated value / do whatever it's supposed to do that replicates it.
If not, tell the instigating client to reset themselves
That's the one I'm struggling with. The reset part
For ammo, maybe just update the hud
But if I kill an enemy and somehow it's not approved, how do I rose it from the dead
I found your explanation to be the clearest, thank you!
That sounds like you're predicting damage/death which is something you don't want to do.
Probably not for death but I'm thingking of just showing the damage text right away
The apply damage will still be on server only
I feel like he's overcomplicating something like a lean. If you're worried about lag, imo it would be better that whatever other clients are seeing is what you're seeing. If in case a lag, I would rather the player not lean than think he's leaning but for others he isn't
id love to see a non-complicated solution for responsive gameplay, I find a delay on a lean to be unacceptable imo
or on all sorts of stuff
but Datura's explanation made the most sense to me, and also I appreciate everyone's contribution
the delay in this case would be caused by connection issues for example, it'll be problematic anyway, you're just impacting what the local player sees with your prediction
๐ค
dw ๐ I'm way too sleepy to be in here lol
my game is co-op, if that helps clear anything up for you
it's totally fine if the local player sees different things than everyone else at slight delays, not like it's going to matter. I'd rather it be responsive for the player
but at some point everyone needs to see that the player is leaning
If locally controlled, set the lean right away. Do a server rpc
yee Datura explained it very well
thank you though!!
I appreciate everyone's contribution
Good luck ๐ wrapping your head around multiplayer isn't easy
even with experience ๐
Hi! Iโm having a problem replicating a bool variable that switches the state from the anim graph from idle to movement. Everything works fine on standalone, server to client but client to server and client to client doesnโt work. Here is my code setting Anim Blueprint in AnimBP Use of Var in StateMachine (going back to idle is just "ca...
Is there an event which triggers at some reasonable place for the last possible moment to get an rpc sent this tick?
Even it it doesn't get sent this tick, it's possible to send this tick.
I fear OnEndFrame might be a bit late.
idk i copied this from an other project i did and it worked fine. i added the replication events as a last resort since the rep notify var wasn't doing anything too
working as intended because i can print a string when the idle is supposed to be false
how do you think i can fix it?
uhhh
why are my different clients only name "client 0"?
Known bug introduced in 5.3. It's because they changed how clients identify themselves. I believe there's supposed to be a fix in for 5.5
does it change anything on replication of variables?
No
alright thanks for the info
but like i have no idea how to fix this
You're attempting to call a multicast from an input event. Input events are executed locally only, so if it's a client calling it the multicast won't fire.
You also typically don't want to multicast state. You use RepNotify replicated variables to control state and must set them on the server in order for them to be replicated to others.
Typical flow is:
Input > Run On Server event > Server sets replicated variables / calls multicasts (if needed)
Idle is also likely something you don't need to replicate. It should be able to be handled locally by clients that you can check in your animation blueprint - if the player's movement component has no velocity, then they're idle.
alright i was looking way too hard into this, it's fixed now. thanks!
Where do I want to be storing secret keys for my server-side API logic?
Is it okay to put those on the GameInstance or GameMode in variables; provided those variables are only ever accessed via dedicated server RPCs?
BP or C++?
What I've done before is have the keys stored in an external file and you don't distribute the file. You can have the game instance read them in on init. This can also allow you to easily change your keys without having to recompile anything.
I think what Matt is hinting at is that in C++ it doesn't really matter where you set them as you have access to be able to decide what gets compiled into a server or client build of the game so you can choose to have the variables be set for a server but those values wouldn't be included in a client build.
In blueprints, including the variables in your Game Instance would be a bad idea as the Game Instance would be packaged and sent to clients, and someone with enough knowhow would be able to pull those keys out. Game Modes you can opt to exclude from client builds if there is never an intention of allowing a standalone version of the game being able to use those game modes, just ensure that whatever game modes you're setting them in that you've excluded them from your client builds so you don't run into the same problem distributing the keys as the Game Instance.
BP
Super helpful, thank you!
Beat me to it
I'm looking in project settings, but would you by chance know which setting is used to configure excluding the gamemode on package? I like the idea of a detached file, but I feel like that would be tricky in BP - or would that be "Load JSON from File"?
In Project Settings, there's a section for "Cooker" which has Advanced Settings that allows you to define classes that are excluded for dedicated clients.
You've helped me in the past and I want to extend a big thank you. I think I'd have abandoned game development awhile back if not for the support from yourself and this community.
Much appreciate all of you. โฅ๏ธ
I've messed around with more settings related to replication of the tile/grid/board without any luck.
Is it even clear to anyone what is happening in the image? It seems like for some reason that tile is aligned to the origin of the actor, but I don't know why it'd do that or how to fix it
Why would a non-replicated character not jump when the Jump function for the character is called while running multiplayer with a dedicated server?
I have non-replicated characters used in a tutorial area and would like these specific characters to not be replicated but they won't jump/take commands even though nothing is replicated.
Fairly certain you can't locally possess a pawn on a client. How are you passing the input from the controller to that character?
It's not possessed. It's just a BP Character placed in the level that calls the Jump function and loops when BeginPlay is called. The debug shows the BP function is being called in the client it just doesn't appear visually. Nothing in the BP is replicated, everything replicated is disabled.
Turn on Replicate Movement. The actor itself can still be set to not replicated so nothing should be getting replicated.
You might be onto something, behavior is so weird. Why wouldn't a non-replicated actor just jump, it doesn't make sense.
Hmmm.. Even with the actor not set to replicated, the replicate movement seems to be happening on the client too, even without the client performing the move.
There's probably C++ code that is assuming all characters are replicated on the server.
I'm trying to get players from one server to move to another server, but it always fails. Can anyone tell me what's going wrong here?
There in the print is the way I currently create a session. And in the second print, the PC's are the players that I get from OnPostLogin. So after using find sessions advanced, I pass the result to this **event **and do the join session
more info: I'm using the Steam server, there are players who** create a session** (being the host) and** join** it (inviting friends from Steam). And I want everyone from the server that I found in **find sessions advanced **to **migrate **to this new host/session (even the current session host, all players)
a) Try putting a ? in front of listen "?listen"
b) Try Open Level (on the client side) instead of Join Session on the server side and see if you can try to use the server's public ip as the Level Name, if it's local it's 127.0.0.1. That's what I do.
Alright, I'll try both, thanks @quaint tendon!๐ค
c) Try the Join Session on the client and not on the server.
After doing a ServerTravel to a map, is the OnPostLogin of the Game Mode for the new map executed? If not, how can I retrieve the Player Controller of the player arriving on the map?
I'm coding a phone system that players can use, and this system plays videos via a widget using a Media Player. However, when a client opens a video and the server opens a different video at the same time, both sides end up opening the same video and they synchronize. How can I ensure that each player (client and server) can play their own video independently without the Media Players interfering with each other?
Does someone know how multiplayer games handle dungeon instances? Like in world of warcraft if you are in party and enter dungeon it creates new instance of the dungeon for your party, when you leave it returns to the open world which is same instance for everyone. I don't understand how it is made and how something similiar could be made with unreal engine.
Kinda varies from game to game but typically a dungeon dedicated server is spun up for you, itโs usually a server that just has the dungeon map on it. You join the server, play the dungeon, and at the end rejoin the last dedicated server you were connected too if possible
So basically players just seamless travel to a different server which contains the dungeon, would that mean they would need to have thousands and thousands of servers running
If your looking for specific technologies that do this, one such option would be AWS gamelift
Potentially yes
But the servers are shutdown once the dungeon has concluded
Some games will shove a few dungeons instances into the same server
Player essentially makes a dungeon matchmaking request, backend spins up a new instance based on the request, gives the party the IP. They join, run the dungeon, and when the players leave the instance is shut down
This is also typically whatโs happening when games have zones or channels
Like in guild wars where they are multiple zone instances for a single map
What about if you dont use dedicated server and one of the players is the server. Is there a way to fake it. Like enter portal -> teleport -> create or load the dungeon which is already inside the map as we cant change the level if server is on a different one
No out of the box unreal only supports a single level loaded
Now you could teleport the players to a map that isnโt visible
Like have your dungeon below the map or something and you just change the location of the player
But then you cant have multiple versions of it
Well you could use streaming levels I suppose
Yeah, i'm not really sure how could it be done that actually all of the players would have its own version of the dungeon..
Might not be even possible
as only way would be propably to load the whole dungeon on runtime like as and instanced actor for each player
or instanced level actor, what ever is the name to pack objects from level to an actor
Yeah usually this would be done with dedicated servers instances
You could do that yeah
you can - you have set areas under the world for each "instanced" dunegon - and each player goes to their own area. As each player leaves, you unload the instanced dungeon, so if you support 10x coop players at one time, you have 10x instanced dunegon spots under the world, and just cycle them as needed.
But still I don't really understand how could i load those dungeons. Yes i could have and area under the world which gets loaded when player enters.. But what if i want to load a new instance of the same dungeon so the both player's have their own dungeon.
level streaming
you just stream it to another X,Y position
so you can have multiple of one dunegon in different positions under the world
or could use something like dungeon architecht
and generate the dungeon at runtime
then move the player to that dungeon
That might be interesting as well
I though level streaming is just a way to hide and load parts of the map when its not relevant
yes - it is normally. But you can do "more" with it
Or maybe there is some fancy staff in world partition
its for streaming in a level ๐
so dungeon arch to bring it up again
can do this for you by not spawning rooms until the player gets close
to help with performance
Okay i need to take a look on it more then as that's something i haven't really touched, if it really is possible to do something like this with it, perfect!
Yeah, i'm looking at it currently, looks really cool.
only just begining to play around with it, its awesome so far ๐
if replicated variables get set in client, do they also get replicated in server and other clients, or do you have to call a server function to set them from a client?
always need to be set on server and replicated out. Clients can RPC to the server
yes
Yes, it is Remote Procedure Call
alright, thanks for the info
So throwing an arrow onto the scene at the origin confirms that the tile is being aligned to it.
Is this a problem with replicated level components? Like some sort of loading order problem aligns it to the origin before actually moving it to position?
It's still only happening on the second+ launch of a 2-player listen server configuration, so maybe it's some sort of caching issue with the editor?
Can RPCs only be defined on Actors and not UObjects or something? I have a UObject derived class that is used as a member property of an Actor Component. The UObject has server RPCs defined it. The compiler certainly makes no complaints about the RPCs being defined, but whenever I try to call them I get an error that say "no owning connection" and the RPC call is suppressed
sigh Even if I move the server rpc to the Actor Component, I still get the same error.
How can a replicated Actor NOT have a net connection?!?!
Ugh. Objects placed in the Editor don't have owners, and thus no net connection. It looks like I have to either spawn these objects from the GameMode or have the playercontroller call a server RPC that then does a NetMulticast, which will get sent out to actors even if they don't have a net connection.
What a mess
Welp! Time to complicate my code some more!
@eternal dune
- UObjects usually don't replicate to begin with
- I do actually not know if they can run RPCs, but I would guess they could. Would still go through the owning Actors ActorChannel though
- For any kind of Server/ClientRPC, the Actor needs to be owned by the Client. That means the Server has to set the Owner to the PlayerController or anything in the chain when spawning it, or it has to call SetOwner on an existing Actor. Both only works if the Server calls it.
i cant remember, by default does the rep notify function fire even if there was no change on the local value or does it always fire? i know its set to OnChanged by default with FDoRepLifetimeParams but im not 100% sure for normal/DOREPLIFETIME
you can use mine, if you want them to be global/always relevant to everyone you could set the game state as the outer
https://github.com/SneakyKittyGameDev/UnrealEngineReplicatedTickableUObjects
Does not fire if there was no change.
ty
Have to use the NOTIFY_ALWAYS arg for the CONDITION macro
Or maybe it is just Notify_Always
I can't remember the exact nomenclature
super close REPNOTIFY_Always lol
in my multiplayer game, when I change weapons, I have to respawn the actor. I spawn on the server, there will be a problem with high ping.
What is the solution to this, best practice?
Just accept it. It is high ping.
It causes a noticeable delay even with a 60ms ping.
Alternative would be to not destroy the actor, make it invisible, disable collisions, and basically do everything possible to disable it, and when you swap to it, do the opposite.
If you wanted, you could do this predictively on the client too, thus eliminating all lag, but that also requires a bit of know-how as to how you revert it if the server doesn't want the player to swap to that other weapon.
Thanks
Maybe use an object pool? Instantiate the more common weapons on map load
Thanks I'll check this out for ideas but based on what I've found so far, the problem is really the Actor being placed in the Editor instead of being spawned at runtime, which determines if it has an Owner and the Owner determines if it has a NetConnection
If a player is hosting a session and he leaves, the entire match will crash, right? Is there any way for me to choose a new host at this time?
It's not that the match crashes, it's that the server disconnects everyone which boots them all back to whatever the default map is.
Unreal has no built in host migration system for such an event.
I understand, thanks for the answer @sinful tree ๐ค
Lots is sudden interest in host migration stuff going on lately. O.o
I know a way, but it's really inefficient
And not the typical host migration
the only host migration i've seen is built right into a custom net driver class
so i think it takes some work and knowledge to get working
I want to add client-side prediction to the firing event, but it's still not working as I want; the latency is still noticeable. Does anyone have any suggestions?
then you didn't predict anything?
Yeah, more specificity would help here, what are you trying to predict and as swires says you didn't predict it if its not running locally with no latency
making prediction work on anything more than a 1 shot click to fire gun can be quite the PITA if you arent experienced with networking/multiplayer... just a warning
Runtime spawned ActorComponents. Does one always just set them to be NetAddressable, or is there a different way to ensure they can be addressed?
It would need to return true for IsNameStableForNetworking, but not sure what the requirements are for runtime spawned Components.
Hello, I'm attempting to joining my multiplayer game, and am running into an issue.
it appears that there is some form of whitelist going on?
I can provide full logs if nessesary.
Request LAN server list -> I can join the servers no problem.
Request Internet server list -> attempting to join:
[2024.07.05-03.13.57:567][961]LogNet: SteamSocketsNetConnection_2 setting maximum channels to: 32767
[2024.07.05-03.13.57:567][961]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2024.07.05-03.13.57:569][961]LogHandshake: Stateless Handshake: NetDriverDefinition 'GameNetDriver' CachedClientID: 7
[2024.07.05-03.13.57:570][961]LogSteamSocketsAPI: Warning: SteamSockets API: Warning [#2154340560 P2P steamid:90199703177629717 vport 27017] Relay candidates enabled by P2P_Transport_ICE_Enable, but P2P_TURN_ServerList is empty
[2024.07.05-03.13.57:570][961]LogSockets: SteamSockets: Now tracking socket 2154340560 for addr 90199703177629717:27017, has parent? 0
[2024.07.05-03.13.57:570][961]LogNet: Game client on port 27017, rate 100000
[2024.07.05-03.14.04:375][252]LogUIActionRouter: Cleaned out [0] inactive UI action bindings
[2024.07.05-03.14.07:571][868]LogSteamSocketsAPI: Verbose: SteamSockets API: Log [#2154340560 P2P steamid:90199703177629717 vport 27017] problem detected locally (5003): Timed out attempting to connect
[2024.07.05-03.14.15:222][936]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = PendingConnectionFailure, ErrorString = Your connection to the host has been lost., Driver = PendingNetDriver SteamSocketsNetDriver_2
[2024.07.05-03.14.15:223][936]LogNet: Warning: Network Failure: PendingNetDriver[PendingConnectionFailure]: Your connection to the host has been lost.
[2024.07.05-03.14.15:223][936]LogNet: NetworkFailure: PendingConnectionFailure, Error: 'Your connection to the host has been lost.'
[2024.07.05-03.14.15:223][936]LogBlueprintUserMessages: [BP_UO_GameInstance_C_0] Pending Connection Failure
[2024.07.05-03.14.15:223][936]LogNet: DestroyNamedNetDriver SteamSocketsNetDriver_2 [PendingNetDriver]```
server console occasinally prints:
```[2024.07.05-03.14.06:777][508]LogSteamSocketsAPI: Warning: SteamSockets API: Warning Ignoring P2P signal from 'steamid:76561198060294593', unknown remote connection #2154340560```
I used the following code to call the run on server event for the left-click input, but there was no change.
This is typically how I like to handle my server/client code if they both run basically the same thing, (i would obviously put more guarded stuff in the FireWeapon that only can run on authorities). Its almost like a recursive func but its not at all. Keeps things simple
void FireWeapon()
{
Result = LineTrace()
Blah
if(!HasAuthority())
Server_FireWeapon(); // << assuming we own the actor (otherwise this RPC wouldn't fire)
}
void Server_FireWeapon() // << assuming this a Server RPC
{
FireWeapon();
}
I'd just call the FireWeapon locally and it'd handled relaying it and calling itself on the server.
I am using the OnFire event as implementable and then using it in the weapon system as Fire through an interface. I think it's not very possible for prediction to work with my method
I believe if you search for "stable name" from Zlo, he has discussed this in the past at some point.
Either him or James have.
Not as helpful, I know. But I don't recall and figure it could at least point you in a direction ๐
Where would you put replication logic for a ui button press that resets the location of certain actors in a level? Player controller?
I try to select random impostor like among us but it select server every time
I trigger it in spawn player. spawn player connected event handle start
all of those things in gamemode
just is impostor bool in character bp
No need to do any of this part.
The GameState has a variable called Player Array which is an array of PlayerStates. You can get the Controller from the PlayerState. The length of the array is the number of players in the game.
To select a random player to be the impostor, get the array, and do a "Random" of it which then selects a Random PlayerState which you can then use to say that player is the Impostor.
I don't know enough English and unreal engine to understand this, if possible, could you do it and send me a picture. It doesn't matter if it's hard for you. I'll figure it out somehow.
Is there any recommended reading material about online subsystems and EOS, more than just create/find/join tutorials?
EOS specifically probably just the docs
Can try pins in #online-subsystems and #epic-online-services
Not sure what exists there
Hi all, I think Im overlooking something. I have a Listen Server with connecting clients spawning in and being set up by logic that exists in the game mode. Weapon actrors are spawned on the gamemode (called from a set of logic that passes HasAuthority() in the character). The weapon actor has a USceneComponent that acts as the emitter location for the bullets.
Here is where things get funky: The weapon actor rotates individually of the owning character based on lock on(this works on both client and server). The emitter debug draw shows that my bullets should be spawning in the correct place for the server and client.
However, when a connected client is playing, the emitter doesn't "rotate" with the gun, it only rotates with the actor, despite being parented directly to the gun and the debug draws working. Here is the kicker: when the host looks at the client (or their gun?) Suddenly the spawning of the projectiles works perfectly on both server and client.
Am I having a relevency issue? What is happening? I have been scratching my head since last night.
In the first picture, the host is not looking at the client, and the bullets go in the direction of the drawn red arrow:
But when the host turns around their camera (second picture) and can see the gun, the bullets go the right direction (sorry you can't see the bullets i just took screenshots not a video)
@neat prism Set the SkeletalMeshComponent to Tick and Update Bones etc. even if not rendered.
It's a dropdown somewhere in the SketetalMeshComponent
you are a life saver. I was questioning my understanding of the engine and multiplayer (let's be honest don't we all)
i have bought the layered fog of war from marketplace
how can i set that team 1 dont see team 2 until they in sight?
i need to code ai perception?
Sounds like a question for the developer of that plugin
Sounds like typical plugin shenanigans
OK you got 2 systems that you need to make work together. You have whatever system is involved in your AI "seeing" things. IDK what you're using but you're using something.
Then you got the fog of war system.
You need to either modify the ai perception setup in some way to USE the fog of war system as the vision test instead of what it usually does by default (line traces I think)
or
You can just not use ai perception and do your own thing.
i really dont udnerstand ^^ ca you explain for a noob?
i ahve the fog of war
and someone told me i have to code ai perception with c++
but i dont know c++ -.-
You're probably way over your head right now.
But you can do it without the ai perception stuff if you want
i can jsut do it wihtout ai perception and only with blueprints?
do you want fog of war vision to be the ONLY way the ai sees?
i have 2 teams
character in team 1 dont see character in team 2
and team 2 dont see team 1
like league of legends
yes i get that
can i do this only with blueprints?
do you want vision to be the only way the ai knows if it can see something or not?
Does the fog of war system support being able to ask if a point or actor is visible?
not really
can i do this without ai percepton? to set it like league of legends
cause the problem is
dont dont know any way how to do it?
i have no idea how to set this
You're gonna have to start figuring stuff out
this is a HUGE mechanic if you're just starting out
i thught i can set jsut team in blueprint and thats all..
From the documentation of replicating uobjects, it says under modifying or deleting a subobject (using registered subobjects list) that AActor::RemoveReplicatedSubobject must be called as the garbage collector will purge the subobject. Does anyone know what modify entails? Does any change such as incrementing a replicated counter count? And in that case, should you remove, increment counter, and then re-add the subobject?
I mean, you can have a "team" variable and set it, but what would that do on its own?
Is there a team variable already integrated with the fog of war system itself? Random people on here won't know much about specific code plugins, but the plugin developer should if they're the one that built the plugin. If there is no integrated team setting within the plugin, then you'd have to extend the functionality of the plugin to include one so that it does what you want based on that team value and that can be a large undertaking depending on how that plugin works and may not be entirely doable within blueprints alone.
Based on this screenshot from the plugin page, it seems like this should already be possible with this plugin.
this works
for the ai minions it works
but not for the characters
the developer will send tomorrow new docuementation
but it dont know if he can do that he tried it today...
Hey guys, I'm suffering with a rubberbanding problem. Can't find what is causing it. Playing on a Dedicated server my simulated proxies are lagging back-forward from time to time, here is a video with the problem: https://www.youtube.com/watch?v=ZJ2dSEGFVZY . Character moves using standard UE Character movement controller. What is interesting this happens to all simulated proxies I see on a screen at the same time. Has anyone noticed anything similar?
this photo in Thirdperson_bp
those in footprint_bp
I want to make footprint that only can hunter see
and the hunter can't leave footprints
just the other players have footprint
if the hunter is a server, everything is fine, but if the hunter is a client, the hunter himself leaves footprints and this is confused with the footprints of the prey, so there is confusion
how can I fix it
How are you setting your movespeed?
Like have you done anything at all to the character movement component, or is it just default?
@gritty warren I have reset it to default for testing purpose, but problem is still there.
check your animations
you can also do something like show net corrections
i forget what the exact command is
but that will tell you if its the server correcting your movement or something else
p.NetShowCorrections 1 is the command
when you teleport, some red and green spheres will appear if it is because of net corrections and lag
I don't have root motion, and capsule is lagging together with the character)
I see, well show net corrections and also your latency
even the default CMC can have trouble if latency is high enough
ok, thanks, and if it is what next ( I guess it will be red and green)
so most likely it's latency issue?
No idea tbh, if your latency / connection is fine and you're using the default CMC and you're still getting corrections, I have no idea what to do lol
thank you anyway)
--
I'm trying to do some checks to determine if my pawn is
A) Client owned on the client,
or
B) Owned by the listen server host on the listen server (e.g., I am host, and I am my character)
For A) I'm just checking GetOwnerRole()==ROLE_AutonomousProxy, which should only be the Client owned on the client
For B), I'm checking GetOwnerRole()==ROLE_Authority to determine if the character is on the server, but I'm not sure how to distinguish if this is also the character owned by the host.
I was trying GetOwner()->GetRemoteRole == ROLE_SimulatedProxy because I thought it'd be a simulated proxy everywhere else, but I'm getting odd results when testing this in PIE
Or rather, I'm jsut trying to print out the various roles, and am unable to get each instance to print on all machines
(e.g., I have 3 pawns, and I want each one to print its own role + remote role on all 3 instances, for a total of 9 print strings)
@gritty warren I usually use a mix of IsLocallyControlled and HasAuthority. If both are true, you are playing as the host. If LocallyControlled is true and authority is false, you are playing as an autonomous proxy. If Authority is true and local is false, its a server simulated character. If both are false, its a client simulated character.
I want to make skin stealer but something is wrond can you help me
I see, there's no way to do it without referencing the player controller?
It's fine to do so, just checking
IsLocallyControlled is on the pawn class, and has authority is on the actor class. You dont need the controllers at all
๐
guys can someonehelp me
i cant get this work
" layered fog of war plugin" from marketplace
every character see each other
how can i hide the other character to another character
The likelyhood of someone being able to help you here with a paid plugin is very low, especially with that kind of price tag.
Your best course of action is go through the documentation, and if you're still having trouble seek support from the plugin owner through their Discord or whatever other support they provide.
https://gandoulf.github.io/enzo-resse/FOW/book/book/Tutorials/Networking.html
anyone know? if i need c++? oder ai perception?
or can i do this only wiht blueprint?
Do you have any idea what this part of the code does?
not really
cause the developer same dont know everything -.-
ts the same like gk fog of war
i bouhgt 1. gk fog of war worked weeks on it it cost me 55 euro
the developer dont know anything
then i bought another fog of war for 90euro
and its the same -.-
Then why are you bothering spending money on something if you don't even know how to read what this does?
gk fog of war 55 euro layered fog of war 90 euro ๐
There's not going to be an 'easy button' to just do things.
i ask them if i can make it liek elague of legends
and they told me yes
you can go on both fog of war
i ask both develpers if i can use this liek league of legends
and i aks if its easy
they told me no programming skills needed
every thign i bought in amekt palce for 500 euro
every thign works well
with documentation
everythign! implentign in 5mins
i got never roblems
only with this fog of war plugins!
gk fog of war updatet it for me ... he update the plugin for me get it work and it dont work
nor the layered fog of war developer give update tomorrow
but i know it will not work
cause if he know how it works he can tell me something
but he cant
tommorow come the update
wrong
To make a game, you WILL need to learn how to program. There's no way around that.
Ok, so you're venting in the wrong place. The vast majority of people here likely haven't even heard of this plugin, let alone know how to do anything with it.
Most code plugins are just that - code. You need to implement the logic they provide with how you want it to work with your game. How you get to that point is more usually far more complicated than a simple flick of a switch, or someone being able to easily tell you what you need to do, especially so if it's something developed by other people. That little tidbit of code is an example of something extremely simple that could be going wrong, and if you don't know how to read that an interpret what it does then you probably shouldn't be buying them. I'm not saying this to be mean or trying to dissuade you, but you're probably wasting your money and time, and most plugins always require some degree of integration with your own code.
If you have problems with a plugin and don't know what to do, you should be going to the source of that plugin, especially if it's something that is paid. Even if the developer themselves can't help you, you can usually find communities (like Discord channels or forums, etc.) focused around plugin developers or their products where there are people who have used it and may have an idea of what to do.
As for that tidbit of code, why you could be seeing both players on the same team is because it's randomly getting a team index and both players could be getting assigned to the same team.
the problem is
blueprint si know how t works
but he told me he write 20k lines in c++
how can i know how something work
he told me 20 k lines of c++ code
i even ask him how something work he cant tell me
Then your problem is with him.... We can't fix that.
before i bought it he told me i can use it exactly like league of legends
Documentation and an API is important for code plugins.
i hoped someone here know how to use it ๐
or have any idea
what i need or have to do
And unless you know how to read said documentation and API, then you don't know what you're doing, thus, you shouldn't be buying these kinds of products as you are likely wasting your money.
And again, someone here knowing is EXTREMELY unlikely. You are in fact the first person in this discord to mention it by name.
Not only that, but it seems like it was only released a couple of weeks ago... That makes it even less likely that someone may know as it hasn't been around for some time where it may have proliferated through the Unreal community.
Reminds me of a guy that was constantly asking for help with playfab on here.... He ended up becoming like 10% of the posts about playfab within a couple of weeks because it's not talked about all that often on here and mostly just as a mention as it being a place that can host games. That's something that has been around for years, yet you still won't find much help on here as it's not something widely used.
You probably don't need to go into C++. You probably dont' need to worry about AI perception. It's likely there is some values you need to tweak.
i found 1 guy with this plugin he got this work
but he dont tell me how ๐
in his discrod he told me 1 thing!
he only send me this side
and told me when i follow this tutorial i will find the solution ๐
thats all he told me
but all people say me i dont need c++ and ai perception
He probably sent you that because it has a mention of Teams and using the integrated team solution (which does require C++) but it's not mandatory to use it, nor do you need AI Perception to determine any teams.
It goes back to this.... This here looks like it is randomly determining the team index. Do you have some other way of determining what team a player should be on? Do you know where this function gets called? Maybe you have some variable already you're using for determining teams that you could potentially use instead?
there nothign works really well
idk how this work
i told ya this is 20k line of c++
how can i know how soemthing work
in blueprints every node has his defintiotn and what it does
here is the components
and some set team values
but i already treid everything
and at the end i dont know everythign waht something does
again its all c++
and for example blueprint nodes i know everything cause it all defined and you can read everythign waht a node doas
lol... 20k lines of code for FoW. Kinda verbose.
he told me
๐คทโโ๏ธ Either way. If you don't want to hire a programmer, I would recommend learning basic C++ to be able to follow and expose stuff in engine. And this is single player advice. Since we're in the multiplayer channel, C++ is practically a requirement. You can do very basic games in BP only, even multiplayer to some degree, but there is so much you miss out on that keeps your project clean and working well.
i think blueprints is enouhg for a game
you can do every thing with blueprints
everything
tbf if itโs actual fog of war, with relevancy and other proper network considerations for both client and server thatโs totally reasonable amount, that shit is complex, if itโs just some hurr durr alpha paint post process then yea 20k is questionable
but a proper relevancy intersection and graphics code and all the rest iโd say 20k i wouldnโt be mad at if itโs for literally the entire integration
I think that is because you haven't been exposed to the full capability of C++. I used to think the same as you, but then started working with C++ and then I realised just how limited BP was. It has it's place but it cannot do everything, and really shouldn't be the place for performance intensive operations or for loops
explain me waht c++ can waht blueprints dont can
every one talking
tell me what i cant to with blueprint only with c++
go fast, implement blueprint itself (if someone wants to take that as a challenge be my guest), use any of the more advanced networking features, anything that involves custom rendering, see how the engine actually works and why your own code does not
I could go on
Half of the engine isn't exposed to blueprints.
Let's be real here, we know which one it is if the author couldn't even provide proper support.
This is just factually wrong
Literary you can't do everything with bp
Go make an async loading screen in bp
Go make sprinting in multiplayer with client prediction
There's soon many things not exposed and you can't just write your own thing, hitting bp limit is very quick
Can't use GAS without cpp, can't make use of libraries. You can only do things in blueprint as far as what is allowed to you.
Don't go 100% bp
Not quite fair to go that direction either
You will see bp limitation even faster in multiplayer.
Multiplayer is possible in Bp and has been done
But you have to understand its limits
Not to mention plenty of plugins that expose stuff for ya in BP
Yeah I mean thatโs just a not understanding the differences
Plugins written in cpp
I never said doing multiplayer with bp is not possible btw
Good enough for turn based game
I encourage people to learn what they have to learn. Or just pay someone to do it
Iโm just saying neither extreme is good
Pretending something can do a job when it's not is just limiting one self
Other types of multiplayer games have been done
They arenโt large in scale but thatโs kinda the point
Sure if your doing an mmo or vslorant
BP only gonna bite you in the butt super fast XD
Plugins isn't really bp only, that's already paying to get what you want from the cpp land
The indie dev who made choo choo charles using only blueprints (game made an estimate of over 5 million dollars) said something like... "Don't listen to people who say it can't be done in blueprints, if I listened to them I would have never been able to complete the game. There's always something you can do in blueprints there's always a workaround, don't listen to them..."
Swords 'n Magic and Stuff is a cozy, cooperative, open world RPG centered around the joy of discovery.An adventure unique to youExplore a large, densely populated open world on your own or with up to 15 friends. Swords 'n Magic is a casual journey of discovery. You play a blank slate adventurer just waiting to carve out a destiny for themselves...
$14.99
781
Open world mutiplayer
BP only
which is what im trying to say
is it an mmo? nah
but it was done
now time for my ban for posting a link lol
with that argument no project is then
casue unreal engine isnt coded in BP XD
and yeah also this
Yes blueprints has its limits
yes C++ overcomes those limits
I'm talking about the need to add cpp class to unlock the limit of bp
but saying you cant make a 100% bp only game isnt always fair
But I didn't say that
Never did
I think thats the impression thats been taken though
all im saying blueprint is a lot more capable than alot give it credit for
sure you will have instances, that often show up in multiplayer, where BP just isnt gonna cut it
I'm happy to unlock the trial version. Something that I regret not doing earlier
If someone come to face a problem where they need cpp, I would encourage them to learn it because of my regret
well yeah if there is a good solution in C++ absolutely
and plenty of times where C++ just does it better
Anyway not arguing about bp only multiplayer.
We had this argument many times
My response was to his comment about what cpp can do that blueprint can't?
Blueprint can do everything is what he said
right and that isnt accurate
The argument is kind of funny because you're both right
I know and I'm sure you agree