#multiplayer
1 messages · Page 150 of 1
I thought that mover 2.0 will be there from ue 5.4. So you're saying that it is possible to use it now? Like experimental or something. Thanks for answer. We're currently still using ue 4.27 but mover 2.0 could be game changer
🙏
you have to build from source
So ue5.4 already is on GitHub or mover 2.0 plugin?
yes
Oh yeah 👍
So I’ve been implementing client side prediction into all aspects of my code and I keep running to the question of,
In decently latent environments the client and the server are never synchronized on certain overlap events. The server overlap or trace will always be slightly behind the client (whatever the lag is).
How do you solve for something like this? I’ve been considering using the clients overlap and then using like a combination of that trace and the server trace like a medium if one disagrees w the other or something.
But I’m curious how others solve for this, I’ve been solely trying to test with higher lag/ping/latency so that game feels as smooth as possible but I also don’t want the player experience to be terrible because of how client side it will always been slightly different from the server
feature wise, good
they even have a vanilla spline movement mode
movement mode are subobject based, pretty neat
yes
don't want it
need it
would also not hate someone giving me even a shred of advice or thoughts to go about thinkiong about my client side prediction and server events being "off" when ping/lag is super high
i have a blast trying mover since yesterday..currently redesigning and redoing my locomotion system im doing right now with CMC with Mover.. althought its in experimental right now, i like how the way mover works and this is one of the reasons why..
i saw in mover there chaosNPP, is that thing still being work on after dave ratti left? havent been keeping up to it
i hope one day GAS can use NPP a well and we can finally have a unify prediction system🙏
is it a bad idea to start to mess with these numbers to acheive smoother gameplay?
They are exposed to be messed with :P
lol true. just not sure on the spectrum of going too far in terms of making things bad for the experience of players. or what would cause performance issues
In most cases the default values are fine
You should simply try to change them to some extremer values with higher ping
And see for yourself
adjusting them all right now just to see haha. well, most. basically want to push it so that things are "smoother" and see what happens
would i make values smaller if that is what im aiming to do ?
lol a lot to take in , im still learning networking (the hard way)
E.g. the Smooth Update Distance is for how far the max distance can be before it starts to be not smooth or even directly teleported
When there is a correction I assume
Bottom stuff is for smoothing
Simulated Proxies are other Clients that see your Character
Listen Server is cause the ListenServer doesn't tick the Client Character by default but moves based on the RPC coming in
No clue what the Shrink Radius is
Rest I would need to double check again
awesome thanks, yea i just changed a few things, hard to fully tell but i'll have to mess w one a time to really know. im using 100 - 200ms on incoming and outgoing, plus 1p packet loss, and it's set to "everyone". i assume this is quite bad connection quality, but pretty much trying to find all the holes
changing these two specifically have given me some good results
NPP?
Such a painful limitation : (
In C++ you can override struct net serialization and implement it yourself
Does Load Stream Level not replicate? I've read everywhere that it does, but it's really not working for me. I've even tried sending the request first to the server and then multicast it, but no matter what I do, it doesn't work. How are you supposed to load a level on all instances?
The level is already a sublevel. It's just a regular Load Stream Level.
Seems so :P
Both can't that is correct. Either implement it yourself or put the key and value into a struct and use an Array
Might be a setting in the Project Settings?
Been a while, but it should be possible to load the Level on the Server and have it replicate to Clients
No need for a Multicast
I don't think there is any setting like that
I tried doing this, no replication involved by the function. If I call the function from the server, everything works properly as expected (loaded on all instances). If I call it from one client, only that client gets the level loaded.
If I set the function to Execute On Server, one would assume it would work, since in the previous case, calling from the server works. However, if the client calls for this function, nothing happens either in the Server nor Client, but if the Server calls it, it work properly as in the previous case.
To sum it up...
No Replication on function
Server: Works correctly.
Client: Loads only on the client that called it.
Execute on Server on function
Server: Works correctly.
Client: Nothing happens anywhere.
Not sure how you're supposed to make this work
Guys how do you make multiplayer without LAN?
You pay for a server
where
Wherever you want
Any good hosting service
and there you have to have the game servers running continously
I have no idea why you would want so much work, though.
and paying a lot of money to keep your servers running
Unless you are making a lot of money already, I don't recommend it
You can do P2P
But that's expected?
Where is that RPC in?
Client loading a level won't replicate
The rules of replication still apply here
The RPC is inside an actor that's in the persistent level. I don't see how replication isn't working as I expect it.
If the server can execute a function with No Replication set and it works on all clients, why would a client not be able to send a request as Execute on Server and not work the same?
Because you totally forget Ownership
Clients can't call ServerRPCs on random Actors they don't own
Whatever Actor you have in that PersistentLevel can only process ServerRPCs if the calling Client owns it
The RPC has to go through a different Actor, like your Character or PlayerController
If you are fine with players hosting their own games, you'd need an OnlineSubsystem that supports Sessions, such as Steam or EOS.
For DedicatedServers those would also be needed, unless you have a backend of sorts that provides the IP. If players should host their own DedicatedServers then that's easier, but that all depends on your game
I’m making a fps so that wouldn’t really work
If you want to develop an FPS that is competitive and has to run on DedicatedServers, which you need to host, then you need to either develop such a backend or pay for it.
It's not only the Servers, but also the dynamic spinning up and shutting down of instances and what not.
PlayFab would be such a Server
I can't recommend making a game like this though if you don't already have a bunch of thousands to pay for this
When does a variable actually gets replicated when the value changes on server. At what time exactly ? Just when value changed or the function inside which the value changed complete's it's call ?
Replication interval of the actor
Replication is done at the end of your game loop, after all your code runs
Ohh
So there might be some system which checks for value change, if changed then replicate. Right ?
I had s bool which was changed twice in a function. And it's Repnotify was not called at all
Rep notify is only executed on clients when a value is replicated to them, if it's C++
And also: yeah the server doesnt replicate every single change
Anything between replication intervals just wont be received by the client
You get the "latest" value on replication
If you need that to replicate every change, then you gotta turn that bool into a struct that also contains an integer and increment that on each change
But I guess even then it wouldn't call for every change
But at least back and forth would trigger
In C++ you can force it to call every change
But I assume this is BPs
For every change you'd need RPCs or your own serialization of history heh
Well, or just set it to repnotify on every change in C++
You'd still need to receive every change which wont happen on an interval
Actually, this is misleading.
- Every Change is probably not gonna happen
- Same Value can be fixed though via either C++ or e.g. an Int in a Struct that you increment
I think that's more accurate
Yeah
For more complex scenarios you'd need to replicate a history of X changes
And pray X amount is enough to not miss anything
Bandwidth hungry but generally fine
Just implemented this and had a chance to test it. No dice. Ive confirmed the VOIP talker is not being deconstructed. This ensure also fails right before the crash. Im out of ideas at this point 🤷♂️
Ive looked at the source code and it seems like it makes a synth audio component for every new buffer of VOIP data. The synth audio component is managed by a remote talker struct. Maybe that is getting cleared during travel even if the VOIP component is alive? I suppose Ill have to dive through source a little more.
LogOutputDevice: Error: Ensure condition failed: !ActorComponent->IsRegistered() || ActorComponent->GetScene() != this [File:T:\UnrealEngine\Engine\Source\Runtime\Renderer\Private\RendererScene.cpp] [Line: 4521] Component Name: AudioComponent /Engine/Transient.VoipListenerSynthComponent_2147479314:AudioComponent_2147479313 World Name: World None.None Component Asset: /Engine/Transient.SynthSound_2147479312
My hunch is that epic marked the issue as "Wont Fix" because VOIP talker is considered legacy. Id imagine they want to put their resources towards eos VOIP
Then what would be the perfect way to play weapon cosmetics effect on a client
How do I force it to call every change
What kind
Animation, Sound and Particles
What I currently doing is an setting a bool bIsShooting which is Replicated.
And when bIsShooting is true I am playing Cosmetics effects from the Repnotify of C++
That's a pretty simple approach
Might not work for tap firing though
You'd prefer to have a shot counter
while registering the replication property you can change the onrep param
DOREPLIFETIME_CONDITION_NOTIFY(ThisClass, MovementSpeed, COND_None, REPNOTIFY_Always); etc
doesn't guarantee the client will receive every value still
I was hoping to get the performance savings of sets, I already use array based systems in my project but comparing lots of arrays is beginning to slow things down
if it needs to be perfect then you will indeed need acks etc I guess
Which condition is used by Blueprint by default ?
I was thinking of using Ammo Counter for this
doesn't let you determine how many shots the player actually shot
a shooting bool would make others look like they're shooting more/less than they did
the reality is it might not really matter to have the remote seem like it shot 20 vs 22 shots
what matters are the ones that did stuff
Blueprint Repnotify doesn't seem to drop in my case
What Replication condition is used by Blueprint?
If you're testing in PIE you're literally in the best conditions ever
You'd need to test in Client net mode + with network emulation on average/bad settings
@solar stirrup You did not answer my above question. Please ...
idk
blueprint rep notify is special since it's called on server too
REPNOTIFY_OnChanged
Blueprint rep notify is on change only
I know, but BP replicated variables should have been using some replication condition. I wanted to know that
void UBlueprintGeneratedClass::GetLifetimeBlueprintReplicationList(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
uint32 PropertiesLeft = NumReplicatedProperties;
for (TFieldIterator<FProperty> It(this, EFieldIteratorFlags::ExcludeSuper); It && PropertiesLeft > 0; ++It)
{
FProperty * Prop = *It;
if (Prop != NULL && Prop->GetPropertyFlags() & CPF_Net)
{
PropertiesLeft--;
OutLifetimeProps.AddUnique(FLifetimeProperty(Prop->RepIndex, Prop->GetBlueprintReplicationCondition(), REPNOTIFY_OnChanged, PUSH_MAKE_BP_PROPERTIES_PUSH_MODEL()));
}
}
REPNOTIFY_OnChanged
For larger array replication you could use FastArraySerializer in C++. Iirc that's delta serialization and also gives you per element callbacks
Ok. Tried with the Ammo Counter part. It works flawlessly
Still don't know why Boolean was not working
any idea how to solve this, interact dot showing for both players when only one is looking at an interactable object
It would work but not if flipped back and forth too quickly
My initial idea was to start playing effects with timer locally, so other clients didn't have to depend on replication on every shots
The Burst Counter stuff is def the best solution
You can still predict it locally fwiw
You'd need to share code
I got to know that. But the problem I faced was that when I start shooting. 1/3 times. The bool was not replicated to other clients
It was dropped.
Just wondering, would it be bad if replication was working for clients but when I try a listen server, the listen server doesn't get anything replicated, I don't plan on using listen servers but just wanted to make sure
not sure if thats easy to see i can send in two parts
Mind telling how ? Cause that would be great
For shooting that's not an easy answer
You would predict the whole shot locally and skip the local client in the on rep of the burst
There are scenarios especially in c++ where that is normal
Such as OnRep calls
Where is that being called
Ohhh okay
Would it be better to make sure the listen server gets it or just leave it be even with no intended use of a listen server?
event beginplay
You can't do that on BeginPlay. That calls for everyone
Your timer runs on every instance of every character
The sim proxy of the other player basically traces and adds the widget
ah ok
I want it only for clients other than the shooter.
Because what I did was fire locally and send that data to server. I know it has disadvantage of dying behind cover. But that's the current design I am using.
You can start this on OnControllerChangedEvent and limit it to IsLocallyControlled
@twin juniper
Yeah then filter IsLocallyControlled in the OnRep
Or set a replication condition to sim proxy I guess?
If you don't need ListenServer to work just ignore it
How does that work exactly.
Sorry for being noobish here, but I haven't used is locally controlled anytime
I have a random dumb question. How would I get something to only run on the owning client? Do I just run it through the client rpc? Rn I'm trying to do a linetrace on client input but it's also running it on the server. Or am I doing this backwards and should run it only on server?
Use HasAuthority() to run only on the server
And Client RPC can only be fired from the server
Perform your linetrace in a function which runs on server. It may be default functions like Tick() or you need to use Server RPC
Well it's supposed to be local based on their message
Okay so from input do server rpc then linetrace?
Nah idk what I'm doing. Asking for advice lol
It's a function of Pawn and Character. You just call it
Depends on what you are doing in general
First be clear. What you are trying to achieve
Alright. I will try it out.
gate that by IsLocallyControlled
you don't want EVERY character to be doing that on all machines, only the LOCALLY CONTROLLED one
Kinda wonder if the GMC's "PeriodicAndOnChange_Output" stuff would be even more accurate
You'd get shooting updates @ the position/rotation the player was at
sync'd with movement updates
Is there any way to check sound replication. FX replication is visible. But how to check if Sound replicated or not
Nvm, got it
why i cannot create session in standalone ?
LogOnlineSession: Warning: STEAM: Failed to initialize game server with Steam!
i am using SteamDevAppId=480
i have installed advanced sessions, but not using any of new nodes yet
a question/discussion about anti-cheat implementation for competitive FPS games.
wallhack/radar cheats can be mitigated by minimizing the amount of enemy positional data sent to clients.
the dream is that a client only receives positional data for enemies that they could see within the next T seconds (T grows with inter-tick latency and jitter). this way, hacks wouldn't be able to detect enemies too far in advance.
well, that's the vision at least. it seems like FPS games tend to not implement this seemingly promising feature.
my question is why?
i have some ideas as to what the shortcomings of this feature might be, but also some potential solutions.
it seems like the server would need to:
- compute a set of potentially reachable locations for player A, and another one for player B
- compute corresponding sets of potentially visible locations
- perform a set intersection on those potentially visible sets to determine whether or not A could see B soon
- repeat for all pairs of players in the server
analysis:
1&2: firstly, there are infinitely many locations. surely, we must first discretize things - voxels?
1: computing reachability would be a complicated factor for games where movement is unpredictable, e.g. those with teleporting or high-velocity movement tech. if the set of potentially reachable locations is the whole map, this entire process is already pointless. ideally, the set of reachable locations for a player is small and easily computable, say, a simple radius around the player.
2: determining whether or not a voxel is visible from another can be tricky, however we can settle for an approximation and err on the side of false positives. line/object trace or render target.
3&4: big perf constraints. we'd need to do this NUM_PLAYERS^2 times per tick. but surely we could precompute the reachability and visibility sets? (with extra care for moveable or destructible objects with respect to visibility.)
thoughts fellas?
Because it's hard, expensive, and if you screw up (don't make relevant the actors that should be), very very bad for the game.
The risk vs reward for the cost is pretty bad.
For automatic fire weapons. What would be best. Reliable or Unrealiable RPC ?
thanks for the reply. i wonder if there's a way to get the best of both worlds? the fact that it's not done extensively, even by studios with extravagant means, makes me skeptical as well.
I think Valorant does it
funnily enough i was thinking of this just after watching a valorant cheat analysis video. i'll have to look closer, idk if valorant did this
i'm more confident in saying that cs doesn't. not sure about cs 2
Better to make your own PVS system and precompute
Like the Source engine
can easily be fed into the replication graph or probably Iris in the future
yes that seems correct
Valorant also does dead reckoning for that
do you mean visibility altaro? i agree that a trace could be used for that, but reachability would require more work. maybe something like 'consider all voxels/points in some radius, scaled by current velocity / hero movement kit etc.'
As in, whatever "cell"/PVS the player is heading towards soon/next is considered as having the player
That way you don't have enemies popping in view
Something similar yes
sick @ pvs
oh ok cool. saw one of the netcode ones, didn't realise they had more, cheers
There ya go
Good read
Unreliable is gonna cause issues of its own
perfect, yeah this is the exact topic, ta
As in players are gonna curse you heh, and also order isn't guaranteed
Although I kinda planned to use unreliable but with my own reliability layer on top for shooting, I opted instead for routing shooting and hitreg through the client's movement data
Still working on that solution, hope it works as good as it sounds
shootergame also shows an example impl
its not perfect tho
Really think it depends, in a game where the traffic is high if reliable events are what's causing your game to tank then there are likely structural problems elsewhere
I think just like casting, people are overly afraid to make things reliable
The reality is making some events reliable will have almost no impact on performance so long as it's not used incorrectly, but the same goes for anything in the engine
Yeah I've studied that video. What I was getting at is that "sparingly" and "low frequency" isn't very clear imo. You should limit how many Reliable RPCs are called over a period of time. Though really it seems many people can't agree on what should and shouldn't be reliable lol
There’s a section where he mentions that a replicated property can most of the time replace a client RPC (server to client). Would this mean by setting a property (variable) and replicating that property like a repnotify event or something? Only to autonomous proxy?
Going to watch this one as well
hey i need some tips
this is when an NPC dies
how im trying to give exp
but its only working for the host*
This shouldn't be an RPC. EXP should be something that is put in a replicated variable.
Oh... Gained event...
Your event in the second screenshot doesn't look like an RPC?
its not, since im getting all acotors of class (i konw this is bad but there will max be 4x players ingame) it should run that event on each locally was my idea ?
You're calling the RPC in the first.. What does that end up calling?
would this also be a similar case for say health? like for getting an enemies health?
Your death event runs on the server, then it calls the "Gain Exp Event" RPC which should technically run on each client that is an owner of a "Player Character". This RPC isn't the same as the event in the second picture, so what does that RPC do?
Why GetAllActorsOfClass? Does every player receive XP when an enemy dies?
And why is that running a ClientRPC?
Exp is a state, the Server should be the one adjusting those values
out of curiousity, are you calling this server rpc and that is passing those inputs into that nonreplicated rpc?
oh wait that is a client rpc nvm
In blueprint I would think it's ok to do an RPC to indicate that there was an increase as you wouldn't get access to the previous value before the value was replicated like you would in a C++ onrep.
It isn't the same event. It's not showing that it's marked as an RPC.
im trying to get an enemy to get forced back when hit, but the movement in high latent envoirnment the movement really gets busted. i thought this node might help and im trying to call this both on the client immeditaly if client says hit and then on server after, which is what is really causing problems, cause, client one will fire, push the enemy, but the server will correct it and then the server will push it back again, and correct it again? its like it doesn't want me to move it at all, always trying to correct the movement. i suppose my enemy movement logic might also be causing issues, as it's directing it towards the enemy, and if that hit happens, it probably messes up that logic cause i dont tell it when it's being "launched, even if quick.
but i am still curious if there's something i can do to help mediate quick movement like this when the server is trying to correct every movement
this seems to be of some interest
Why would you need that
If that's for UI, you can always cache the last value in the Widget
AI is Server Auth. You don't do any good with calling it locally
You'll have to live with the ping in theory
You can utilize RootMotionSources, but those are GameplayAbility only unless you expose them to normal async tasks via C++
Won't remove the initial correction, but might look smoother overall
That is a solution, but what if you just had something that pops up an exp gained message and you wanted multiple values to be shown being given, but all happen to be added at the same time? Eg. A bunch of enemies all die at the same time (like AoE damage), and you want the player to see a +exp for each enemy. If you were to just add the exp all at the same time to a single exp replicated variable, i would think there would be only 1 rep notify of the variable, so only 1 message could end up being displayed.
So rather than say one big +3000 Exp for killing 3 enemies worth 1000 Exp, you wanted it to show +1000 Exp 3 times.
But, it's not my system anyway, I'm just thinking that there could be a use for an RPC there.
yea the node im using is actually from gas, i got it as a standalone plugin that i compiled from someone exposing it
but yea it still doesn't seem to work, and again, im on high latency
i mean it works, but just corrects a lot. i wonder if a stun/slow movement would be better? or would it essentially give the same results
Oh, so it has to go through an actor the client owns so that it has the right to send it to the server? I guess that makes a lot of sense.
Thanks for the information, @thin stratus. I knew I had to be missing some vital information when it comes to replication.
Question on replicating flipbooks. Dice plays flipbook on the server side, but not on the client side.
The dice is just an actor that has a flipbook component. Replication is on.
can you show me how you're playing the animation?
i use flipbooks for my characters (it's a 2d sprite) so i might be able to help
Fair I guess. I was more thinking about persistent changes like a Healthbar.
Simple flipbook component with dice sprites
Is that auto played?
Or are you starting that from some event
yes auto-played
How do you sort a fast array?
I'm getting this error trying to sort my array:
Assertion failed: FixedShadowIndex > Index [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\RepLayout.cpp] [Line: 7714]
Algo::Sort(MyFastArray.Items, [this](FMyItemStruct& First, FMyItemStruct& Second)
{
if (First.Count < Second.Count)
{
MyFastArray.MarkItemDirty(First);
MyFastArray.MarkItemDirty(Second);
return true;
}
return false;
});
I have a real weird problem
I have a BP_Flag which is an actor that sends a destroy RPC to the FirstPersonCharacter Actor whenever I overlap with it
It works perfectly with BP_flags that are placed through the editor, but any BP_flag actors that are spawned through the FirstPersonCharacter actor (After AnyDamage) are not properly destroyed and still show up for the client.
What could be the cause for this?
I though maybe it could have something with the overlap so I tried to remove as much as possible from the script and it still has the same issue.
I also made it so I spawn without any checks using a key
This is all the script that gets executed
Oh. Now I can see that when it tries to destroy on server it actually gets a (Is Not Valid) Which you can see on the second picture.
Hello @lost tinsel I am noobie. Should I enable seamless travel in server GM (Server Map) or client GM (lobby/Menu) map ?
Anybody know why either of these functions keep failing to call Cycle turn?
Hm not really. More wondering why you need so many RPCs
Seamless travel should be turned on on those that have a server with clients connected
because game mode in on the server and would be a Node not found if i didnt run it from server. but then the set visibility will only work from client.
Visibility is a state and should be done through Replicated Variables though
You aren't supposed to constantly go back and forth with RPCs
any other way i tried to set visibility based on turn didn't work though. I tried tying into the button and its get a Node not found. I also tried to tie to the TurnChange Event and didnt work. What better way would work?
@sinful tree sorry for late ansswer well its not marked as Rpc i think getting all actors of class is like a rpc is it not :/?
Hello, did anyone face an issue with anim notifies in dedicated server environment? I have an animation montage with a few anim notifies in it, which work perfectly client-side. Dedicated server-side, however, it doesn't: sometimes it doesn't trigger any anim notify, sometimes it triggers one of them (it might not be the first one on the timeline, but last), sometimes it triggers all of them.
Edit: Weirdly, setting SkeletalMeshComponent's VisibilityBasedAnimTickOption to OnlyTickMontagesWhenNotRendered makes it work perfectly. The weird thing is that it works client-side as well, even though it is rendered. 🤔
Edit 2: It doesn't update bones, leaving the player it default skeleton pose even during animations, so it doesn't work 😔
Edit 3: Making anim notifies use MontageTickType BranchingPoint works perfectly
How do I make a DebugLine drawn on server to not shown for the client who drew it
But others can see it
This might be it. It's under Editor Preferences
Not this
I am drawing a debug line on server via rpc
As I who is drawing that, I dont want to see the debug line
I only want other clients to see it
Why would my game mode not be valid??
Variable is obviously set to null
GetGameMode and casting it is almost certainly preferred here.
Thanks mate first time doing it. Got it figured out! Didnt know you had to cast to it and save it as a variable to refrence it in other functions
I recommend not saving it as a variable to be honest. It's pretty straightforward to get to
caching stuff that way is a good catalyst for bugs
ok gotcha WIll see if itll work without doing that
Hey guys, are there any existing/built in ways of knowing (on a client) when an actor was last replicated/updated? Or do I have to run my own replicated variable (that stores the current game time) and keep updating/incrementing it from the server?
Only if the actor channel is currently open
UNetDriver.FindNetworkObjectInfo()->LastNetUpdateTimestamp
Otherwise no, you need to store your own value
LastNetUpdateTimestamp also isn't related to world time
PostNetReceive() would be a good place to store a timestamp, though not sure why you'd want it exactly
Hey, Jambax, did you face this issue?
Dedicated Server never renders anything, so you probably want AlwaysTickPose, and you probably want branching notifies if you want them to be reliable.
Might not need AlwaysTickPose for montages, can't recall
It was AlwaysTickPose, but it didn't work out.
and you probably want branching notifies if you want them to be reliable.
I have heard about "branching notifies", but what does it mean?
oh, is it it?
I find that if actors go dormant while still inside of a client's relevancy range, they stay alive client-side even if the client goes way outside of the relevancy range. I need a way to destroy these left-behind actors, as I cannot guarantee that the actor will be awake until all clients have the actor automatically destroyed (by relevancy). Currently I keep a replicated timestamp, and the clients check if it has not received updates for a long time, so they can destroy the actor. But I'm looking for a cleaner way that still allows me to make the actor dormant on the server whenever I want (without it staying alive on clients regardless of distance afterwards). Hope it makes sense? :x
That's the point of dormancy, to close the actor channel and no longer send any information about it. If you destroy the actor client-side, and it's a map-startup actor, it will just fail to resolve when the channel is opened again.
They are spawned runtime (think NPCs). A server-side system makes range checks and makes actors dormant if far away enough from player chars to save on performance. If the server makes an actor dormant before relevancy destroys it on client, with a large open world, those npcs would be lingering around on clients tanking performance (on clients). Am I doing something wrong with dormancy or what's the right way?
Yeah that - branching point should IIRC be more reliable since they execute inline rather than being queued up to be despatched after anim evaluation.
Yeah, it works perfectly from what I've seen so far 😄
If they are spawned at runtime, then I would just use relevancy.
Dormancy closes the channel, loses all the shadow variable state etc. It's really a perf thing to avoid the server having to prioritise the actor for replication, but the idea is that actors are preserved.
Do I use SetReplicates (false) instead of going dormant then if I want those actors to get destroyed on clients or would they still stay around?
I guess the tldr is that I need to 'turn off' NPCs on the server without actually destroying them on the server. And I want those 'turned off' NPCs to disappear from all clients instead of being left behind.
SetReplicates would just stop them replicating, so clients would stop getting updates, including the one to tell them to stop replicating
And they would still remain on clients also. Making them dormant when they are out of player relevancy range isn't strictly what dormancy is meant for, it's meant for "this object isn't going to change at all for a while now"
Hey everyone! I have a multiplayer game where I am trying to get each players playercontroller through the gamemode. I have an array of player controller object references, and then I cast to the controller for the mode and try to send that into a new function. In the new function I get the error "Accessed None Trying To Read Property PlayerController". This only happens for the client, but for the host it gets the player controller properly. Do I need to do something specific with the client to get a cast to their controller on the gamemode?
You might have to hook into the net driver and listen out for actor channels being closed, maybe then you could destroy the actors client-side - but I wouldn't be surprised if that causes new issues with resolving object GUIDs
If it matters, I am getting an array of playerstates from the game state, getting their player controllers, and then using those to do this cast
The GameMode only exists on the Server. PlayerControllers only exist on the Server and the Owning Client.
You will get Acess None if you try and read the GameMode on a Client.
I am trying to read the client on a gamemode
You will get Acess None trying to read other Players PlayerControllers on a Client
What do you mean? You dont "read" a Client on a GameMode. The GameMode is on the Server.
Do you mean you are trying to iterate PlayerControllers (which represent Clients) on the Server?
Technically that is exactly what I'm using it for. If no players are around, NPCs dont need to update their state = they aren't going to change for a while. But it's good to get confirmation on actors still being left behind.
I want to cast to the player controller from the gamemode and do something with it (still on the gamemode)
But the cast fails if the player controller belongs to the client
You cant Cast a GameMode to a PlayerController, they are entirely different types unrelated to each other.
So that means there is no easy/clean way to cleanup those actors, thanks for the confirmation and your time!
Where exactly are you getting the list of PlayerControllers from?
How are you building that list?
Here
So if I want to send an event to the player controller to possess a pawn, how would I let the pc know to do that?
Ok how are you getting the PlayerController from the PlayerState?
Should be able to use GetOwner()
PlayerControllers have a Possess function natively.
Get game state, get players array, loop, get player controller for each player state, add to array
Clients only have their owning controller remember
You can't access other clients' player controllers on clients
You should not need to Cast a PlayerController in order to call the Possess function.
I am doing other things to the player controller before using possess. I was just mentioning that, sorry for the confusion
@chrome bay He knows that now, he is in the GameMode so no issue of that.
Are you 100% sure that your Casting to a valid type for that PlayerController.
I should be, it's the default playercontroller class for this gamemode
I don't have anything overriding that
If you breakpoint on this ForLoop, can you see that it contains all of the PlayerControllers? And are they of the right type?
I also tried using a blueprint interface instead of a cast. Also failed
I will try that. I have used the print and it does print twice implying there are two player controllers in the array
Yes but they might not be the right type.
Just knowing there are 2 is not enough info.
I will check and be back in a minute. Thanks for the advice 🙂
Huh, yeah one of them is still the player controller from the menu before they joined the session. It's a different level though, I thought it would change to the new one when the level loads?
I am using servertravel to go from the menu level to the game level. The host gets a new playercontroller type but the client does not I guess
Do you know how to make the client change player controllers? I can't find much for that online
Anyone know how to spawn an item from a character? I have an enemy that on death I want to drop an item.
When the player drops it it works correctly (I do an RPC) since I have the player controller I can spawn the item on so it gets replicated to everyone correctly
However, on the character I don't have a player controller I can do this on
Hi, do you know how to make rpc functions work with c++ interfaces? mine ended up getting executed in server even though it was defined as UFUNCTION(Client) can called via Execute_Name. Thanks
The PlayerController is only ever defined by the GameMode
Players can only have their PLayerController changed when the GameMode changes.
I don't understand why the client is not changing then. The lobby playercontroller is set in the lobby, and then when servertravel is used it goes to a new world with a different gamemode and default playercontroller. But the client keeps the lobby playercontroller
make sure your character and new item classes replicated and also add the new item to replicated subobjects. Spawn the item on server. It should replicte
Has anyone ever seen an issue where after you load into the game a high ping client doesn't get issued a new controller (between lobby pc to match pc) whereas all the lower ping clients do?
Why would a client have to wait for a 3D widget that is in the scene to 'replicate' when the 3D widget is a static part of the scene (not spawned, but placed in the level). I just ran into an issue where a value had to be set on the 3D widget from the actor that holds it. The value is set with repnotify, however when the repnotify fired on the client, the 'user widget object' from the widget was returning 'unknown'. Add a delay of a couple seconds and it returns the widget. Widgets (even 3D ones) are locally relevant are they not? and the widget is a built in part of the scene. I'm not sure why you'd need to wait for it. Or is that just some quirk of testing in PIE?
can i turn on replication of actor after begin play?
I am making data driven game it is designed to level designer to write what should replicate and locate position by json file like below: { “Name” : “BP_ABCD”, “ShouldReplicate” : “true”, “Location” : “X:111, Y:222, Z:333” } So, I want to turn on replication of actor after beginplay by data. But UE_LOG(LogTemp, Error, TEXT("AEventMul...
You can enable or disable replication as you like
thanks ! but my custom actor component is so weird.
does not replicates its radius or set visibility boolean
can you advise that?
i will search for net cull distance !
thank you for attention
Anyone knows this error? 😦
Warning: UActorChannel::ProcessBunch: ReadContentBlockPayload failed to find/create object. RepObj: NULL, Channel: 7
hey guys, im having trouble with replication (i think). The "container inventory component" is a replicated spatial inventory component based off of Reid's channel, it works fine for personal inventories, but im having issues with chests/containers. From some debugging and print strings, ive found that when the server host opens and adds to the container, it shows the container has the items in it. But when a client opens the same container, it is empty. Both can add and remove from the container, but it seems to only update/store items locally (works exactly like an ender chest does in minecraft lol, not my intention). Any ideas what im doing wrong?
How do I replicate A UObject Property in c++?
I have
// .h
UPROPERTY(Replicated)
ULyraTeamSubsystem* TeamSubsystem;
// .cpp
void UMyGameStateComponent::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME_CONDITION(UMyGameStateComponent, TeamSubsystem, COND_None);
}
but when i try to set the value of TeamSubsystem on the server, it shows as null on the clients
ULyraTeamSubsystem is a world subsystem in my version of Lyra
if you want something that's like a manager singleton that has replicated properties you will probably be better off with a component on the gamestate?
what Lyra does is create some replicated manager actors from the subsystem (ALyraTeamPublicInfo)
The reason why i want it replicated is because i wanted the variable to be cached instead of repeatedly calling GetSubsystem everytime i need it
why does it need to be replicated to just store it after getting it once?
you can safely assume world subsystems will at least have tried to init upon beginplay
unless they are conditional
Im setting it in the server.
not sure how that relates to what I asked, I feel like you mean something else
I assure you if the issue is "I think getting a subsystem is expensive" replicating anything you don't need to will be far more costly and complicated
So its safe to call GetSusbsystem every tick?
safe? sure?
I am going to go out on a limb and say the cost of accessing the subsystem storage map will be the least of your worries
if you ever find it actually shows up in profiling just cache a pointer to the subsystem upon beginning play
replication is a tool to make stuff happen on two peoples computers over the network (server->client), this is not saving on much unless the server knows something the client cannot here
it's good to be concerned about performance but you need to be able to actually reason about it
Alright I think i got it. Thanks!
there is a world where it actually does save on CPU time by sending over the result of some expensive thing to clients
saving them the effort of figuring out the result
but probably not here
does anyone know if its possible on a listen server to send one of my clients to a different map. For example: is my client(host) dies id like them to go to "MainMenuMap" and then send my client(the person who joined and "killed" host) to "VictoryMap"
doesn't work 😦
owner of actor component doesn't IsReplicates = true on my client
You can force Clients to move to a different level locally, but that would cause them to disconnect from the Server.
A Server can only ever be serving Clients one level at a time.
There is no multi level support out of the box.
that explains why when i kill either client(host) or client(server) it only send the host to the desired level
i wanted to make it so if the client(Host) or client(Server) ever killed one or the other the host could be sent back to the MainMenuMap and or the VictoryMap same for client(server)
insteads wether host or server dies the only one being sent to the mainmenu is the host no matter what
I know this is probably a basic question, but is there a simple way to replicate a Variable to all clients.
(Since most forms or replication, Replicate the actual code, which on the clients the value is 0 since the actual damage is tracked on the server atm)
@late iris in what way like have a text both windows can see?
this is how i replicate objects to both clients on a listen server
void ABasePlayer::GetLifetimeReplicatedProps(TArray <FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
//Replicate current health.
//DOREPLIFETIME(ABasePlayer, CurrentHealth);
}
this is how our currentHealth variable is replicated to both clients
The ideal is to Either have it so when the Sync check Variable changes on the (Listen) server, for it be replicated to all clients OR,
When the Set text node changes the text on the server, to change it to be the same for all clients.
But i'm unsure as to how to do that, as it seems all the replication does is replicate the code. which on the clients side, the variable is empty(due to damage being handled by the server).
I started using mover 1.0
This is so good and flexible. The down side of this mover plugin is that many existing code have to adopt it’s design patterns.
RMS no more, jump, launch, and double jump can categorize to a single concept called “layered move”, all supports client prediction and rollback.
Many code using character movement component will have to do some works to migrate to mover, but mover is the future.
UE 5.4 will have mover 1.0, I think mover 2.0 has a long way to go.
these havn't happened yet.
how to replicate varible in this case?:
1 Server: set int_var="123"
2 Client: after few moments new client joins to server
3 Client: client ask server what state of int_var is right now?
4 Server: Sends int_var="123" to Client
i saw that play montage node inside mover comp..im currently tried integrate it with gas ability task and it works the same but in GAS, i noticed there some corrections..could be because i use GAS and its prediction system is not npp
yeah even now, if you go to default mover map, you can see some jitter in the movements for something as basic as dodge or walking
Mover still need some polish, but the architecture and concepts are pretty good.
agree.. just the ability to use whatever capsule coliison shape (the primitive type shape) is huge for me.. doing that with CMC is such a pain
Hi, what's the best way to save data in multiplayer? My goal is that when the player opens the game and goes to their "hideout" the data is then loaded. What's the best way to save / load this? should i use game mode, game instance or level bp.
Also players will be able to connect to the "hideout" however i only want to set the host / initial players data when they join the other connecting players should bring over their own data from their "hideout"
Set the variable to replicate. The client will sync with the server values eventually. The client doesn't need to ask the server, it just receive the server values when the server reached the client
so if I understand correctly you want players who join another player to load their own gear?
yeah
If you're fine with having the most hackable game in 2024 then you could start by loading the save in the game instance and saving a reference to it, once loaded you can send that data to the host, and have the host spawn it
keep in mind you'd have to send that information from somewhere other then the game instance though
My cosmetic is a replicated variables that load the soft ref on repnotify
When client join, it send server rpc to update the cosmetic struct, that's it
Did it on acknolwdgepossesion for client
As for the listen server I do it onPosses
Each player would load their cosmetic from the save file in the load game menu
if have a struct variable declared like this:
UPROPERTY(Transient, ReplicatedUsing = RepNotifyBypassSourceEffectChainEntry)
FBypassSourceEffectChainEntry BypassSourceEffectChainEntry;
and want it replicated.. when I do this, the repnotify method does not get called, what am I doing wrong?:
BypassSourceEffectChainEntry.Set(EntryIndex, bByPassed);
are there any good videos or articles on it? and at the moment im just trying to wrap my head around it so hence trying to use the game isntance
Also what would be the best way to not have it hackable?
a database, which would quickly get expensive if your game suddenly released and blew up
but the concept you're trying to do is not all difficult
all you need to do is learn how to use the save system in unreal engine
locally save all your items before the session ends, and then load that save file once you've entered a game
if you are not the host, then you just need to RPC to server (a replicated event) containing all the items you had from that save file
It's probably harder to create the save/load logic then it would be to receive your items in multiplayer
Much Appreciated @short arrow .
I have a multiplayer question, an overlap event only fire on client and don’t replicate right? How can I ensure that only the player of the client can fire the overlap event for this client, because I want to set player information to an non replicating door by overlapping but if a second player run into the collider the overlap fire again on both overlapping clients right ?
Overlap event will trigger on server and client. Remember that trigger volume exist both on server machine and client machine
Would you have a reason to care about the overlap event when client machine overlap the box in their world?
If u don't just use switch has authority to let it only run on server side
Something like a pain volume, the client doesn't need to run anything. Have a switch has authority on the overlap box and let server do everything
thank you!
why is it being replicated like that ./
Hello, I'm making an online game that has melee combat with combos. The players are meant to hit the attack button in a certain time-window to carry on the combination. What measures against cheats are out there? If I'll make so that the player can continue the combination only when a certain anim notify state on the attack animation montage is active, it won't work perfectly due to some possible inconsistent ping (attack animation is played predictively client-side).
slowing down the character speed only works on standalone game, playing as client it is not working
afaik CMC is replicated so why it not works?
gameplay being directly dependent on animation seems a bit disasterous, especially in MP
in the past, I've always cached timings that are animation dependent at save time
wdym at save time?
when the BP/data asset that contains the animation data is saved
How do you slow them down
show code
But isn't it kind of the same thing? You essentially tell what's the time window the combination can be carried on, however, if the player has some inconsistent ping, they might hit the combination time-window locally, but not for the server
Not really, because of framerate differences between client and server. The client would usually send a timestamp with such commands anyway
Though this is something I'm hope NPP will help fix since Mover 2.0 actually uses it
press ctrl -> bWalkState = true;
if(bWalkState) { WalkSpeed = DataWalkSpeed.Normal_Stand_Walk_Other;}
walkspeed is passed as input in charactermovementcomp walkspeed
Oh, timestamps, I'm not using them. Is it something I have to build myself, or there's some UE support for that? Do you have anything to read about them? I have the idea about them, but I have never seen their implementation or anything like that
but if i replicate the walkspeed variable using onrep on server, it works
The game state holds a world server time, which is actually implemented a lot better than it used to be. NPP is supposed to be a general purpose network prediction implementation, which I've used with some success
The next gen CMC (Mover 2.0) uses it
So at least that means it ain't dead
its a plugin?
Yes, it's in main and the 5.4 branch
https://github.com/EpicGames/UnrealEngine/tree/ue5-main/Engine/Plugins/Experimental/Mover it's still very early days
Thanks very much
What's NPP though?
Network Prediction Plugin
Is it a UE5 thing though? I'm using UE4.27 for this project
It's kinda in 4.27, NPP was dead for a while but Mover is reviving it
Oh, all right. Do you have any article talking about it, or do I have to go through source code to find out how it works?
With NPP, you build an input command, you run a simulation clientside, the server runs the same simulation, if there any differences then you resimulate everything after the error occurred
It's very much an inspect the source code deal, but the 5.3+ readme is pretty useful
(or whenever the readme was actually last updated)
I guess I can find it under UE repository under plugins?
Perfect, thank you
I need help. I am building a multiplayer game where water is part of an important mechanic. I was reading that some fluid simulators have limitations in multiplayer. I am new to game development overall. What is the best fluid sim for multiplayer?
can we do a single onrep on two variables?
UPROPERTY(ReplicatedUsing = OnRep_MoveForwardAxis)
bool bEnableMove;
UPROPERTY(ReplicatedUsing = OnRep_MoveForwardAxis)
bool bValidSpeed;
I don't know about best practices, but there isn't anything I can see that stops it from functioning.
Ok
you may watch the article, https://vorixo.github.io/devtricks/mover-show/#conclusion I change network prediction setting "tick policy" to "independent" , then the jitter goes away.
Question regarding Player States and server travel. So when the "Host" server travels, does the player create a new player state or do they take the old one?
If they make a new one, how can I move the variables from the the old one to the new one? The variables aren't being stored on Game Instance, should I store them on there and then move it to the new Player State?
oo i might check thatout
I have a question that is maybe a #multiplayer question, but guess it's also #audio . I have an actor with a AudioComponent that replicates. On that AudioComponent i've set a SourceEffectChain with a number of effects that I want to be able to turn on/off using SetBypassSourceEffectChainEntry (i know the index of the effects i want to toggle).
So when I do this from the server, the client can hear the change, but when I do this on the Client (doing a ExecuteOnServer RPC), it doesn't work. Any ideas what I may be doing wrong here?
I dont know what other people do, but i’ve packed them into a struct before with good results
Hello, I have been working on saving a variable to a local player. So each player saves it's inventory and gives it to the server but can't get it working. Only server get's his inventory and clients get Null. Can I use this node ? (CF just like valheim)
U trying to save the data on the client?
Yes
That is exaclty it
Like when Pawn is Possessed I want to give I'm his items from the SaveGame file
Ok
Then it should just be a matter of checking is local controlled (i think) before saving/loading your inventory
But u wrote u wanted to give something to the server. Its unclear what u meant by that
So the Client gives the List of items and server gives it
Tried with this and Idk doesn't work
Eh? Either u want the client to give the data or the server
Client gives variable, Server reads variable and launches function
Do u mean that the client has a list of items and the server should spawn them?
Yess
The u’d call a onServer rpc with the variables in and the on that event, spawn your items.
What would be the global structure and what to give to each actors ? I'm wondering if Game instance needs to be involved or not or just Player Controller and Pawn
Start by deciding if you want clientside or serverside inventory
I joined a game. Who says what items I have, me or the server?
In whatever holds your inventory, probably an inventorycomponent:
Clientside version:
Begin play -> load game -> tell the server your items (Run on Server RPC) -> server sets replicated items data
Serverside version:
Begin play -> load game -> set replicated items data
It's that simple
So in a Listen server scenario would that be the same ?
hey
I just get this error :
[2024.02.05-15.12.28:902][ 13]LogNet: UNetConnection::SendCloseReason:
[2024.02.05-15.12.28:902][ 13]LogNet: - Result=ControlChannelClose, ErrorContext="ControlChannelClose"
the game is using steam subsystem any idea what can cause that ?
yes
and don't use clientside inventory if you care about cheating at all
Oh yes sure, I don't mind ahah
interesting... is this like an upgrade to CMC? or just a way to make it easier for custom movement
https://vorixo.github.io/devtricks/mover-show/ was already linked above
oh nice shoulda scrolled a bit more
Hi, beginner here, does anybody know how to make it so not every gamepad assigns itself to player 1 in a local multiplayer splitscreen scenario? I have skip assigning gamepad to player 1 checked as true, and the splitscreen shows up when I Create Local Player in the level BP, but my keyboard and the 2 gamepads I have connected all control player 1. At the very least I'd like the second gamepad to be controlling the second player, but it would be ideal to only require keyboard and one gamepad
Important note is that I'm using spawn actor and possess in the level blueprint, because I want each player to control a different pawn.
sadly there isn't a fix
happened in 5.1 and it's still a thing in 5.2 haven't used 5.3 mind you
I even tried to get help from my lecturers (I was doing an unreal local multiplayer course) and after weeks of trying they still didn't have a fix
Im on 5.3 and yeah nothing
I spent so many hours trying to figure out how to fix it
Wow thats insane
Honestly it's just an unreal bug I couldn't find a workaround
U'd need 3 controllers
to control player two
or two if you're using keyboard as well
Thats the weird part is that I had 2 gamepads and keyboard connected and it still wasnt working so maybe I did something wrong?
so youd put two controllers as extra input and then controller 2/3 would be able to control player 2, you'll get two simultaneous inputs from both controllers causing player 2 to constantly have input
I'm not sure but whenever i'd set up a quick local multiplayer, it'd work with three controllers
at least player 2 would work with the third one
then again this is 5.1 and 5.2 so maybe it won't even work with 5.3
I think i might know how to make the 3rd one work when im back at my computer ill test it
I don't see this getting fixed for a while tbh local multiplayer games are a low priority as most games don't use it (on pc)
It would impact people wanting to put the game on console such as a racing game
So for saving the local players value and sending it to the server Idk why it doesnt work - This is on the PlayerPawn
Clients get 0 items while server gets the right amount
Is there something that needs to be done in the Game Instance specifically ?
General question : Why do people usually say that doing Multiplayer is way harder than Solo games ? What makes it difficult
To my knowledge, gameinstance is local to each executable and does no replication
I've currently got a problem where clients (after the second client) can't see the correct server and instead see different ones (Steam subsystem is enabled with gameengine.ini settings). Lobbies shown are both LAN and ONLINE. Very confused, I should be able to see my LAN server that one client created for both clients not just one.
Yes actually I dont need the values replicating from game instance
Not sure, but im using the advancedsteamplugin and havent seen such issues. So maybe switch to that
It's just seems like the client doesn't get to access the save slot
Number one enemy is ping.
I might be mistaking but this should give me the value on the loaded game no ?
Thought advanced was a temporary plugin solution to broken unreal engine working with steam, hasn't that been fixed now? Seems to be working with just the base plugin and game engine file changes
I dont know.. i returned to unreal engine after taking a few years break. Last engine i was using was 4.27.2 snd now 5.3.2
Seems alive
Why are u placing it on the gameinstance? Normally its fine to have on ur char og playerstate.
How are u saving the items and how are u loading them?
I'm using advance session with steam, no issue
think i've figured out the issue
only the one connected to steam can't see the lobbies
yeah so i'd package it
But with multiple computer?
Saving from the playerpawn and transfering to GI and loading that's what I'm trying to do here
Can't use 1 computer that run multiple instance
it wouldnt work though with only one cuz ive only goto ne steam account
You need at least 2 computer both running steam before running your build
You should call the loadsavegame and savesavegame nodes
Not afaik, buy a laptop maybe
dang
It's painful to do a mp game without being able to test the packaged version
i've got friends who can test but do most devs really go on a whim hoping it'd work
I test with LAN checked on one pc with 1 listen server and 2 clients
Just launch as standalone
That's only for connection without steam
Yeah
I just couln't tell which client was using steam and now I've figured it out
Hoping to get some help with a server travel issue. I am using Lyra in 5.3 on dedicated server and I am getting was seems to be a replication error after 2-3 successful matches. I found this post in which a user has the same issue. The post is near the bottom of the page. Was hoping someone might have info on what causes this?
https://forums.unrealengine.com/t/player-state-not-valid-after-servertravel/473321/7
On 5.3.1. running a dedicated server → client model this problem is still here, but the problem I’m running into isn’t the player state but after 3 rounds against bots on the map change I get spawned in the ground and can’t do anything. After doing some trial and error I found I do have a valid player state but don’t get an pawn: [412]LogBluepr...
the error i am trying to research is this: "UActorChannel::ProcessBunch: New actor channel received non-open packet. bOpen: 0, bClose: 0, bReliable: 0, bPartial: 0, bPartialInitial: 0, bPartialFinal: 0, ChName: Actor, ChIndex: 78, Closing: 0, OpenedLocally: 0, OpenAcked: 1, NetGUID: 0"
the engine code states that this non-open packet issue should never occur but it seems that I am getting it
can anyone point me in a direction?
is there a way to set net dormancy or network update frequency on static mesh foliage actors? i can't find any settings for network related things
why do you want your foliage to be replicated at the first place?
it's harvestable but when placed in the world is a foliage actor
What is the best default hotkey to use for chat messages? Currently im using Y but I'm open to hearing other suggestions. The player can always rebind it in the options.
voice or text
text chat
that seems fine? or enter? or T
I think a lot use T
T for general, Y for team? something like that
how to replicate varible from Client->Server
ServerRPC in a Client-owned Actor
GameState is not Client-owned?
Nope
something like player controller?
Yeah
Than worked! Thank you.. little by little im starting to undersand how this works
player state is also owned by its relevant controller
Does a new player state get created when you server travel to a new level?
Yes
I have a scenecaptur2d on my character to make a previewcharacter on inventory ui but is jittering on mp
How do we get the previous player state variables onto the new one created or would I need to save them to a game instance and call for them to be saved onto the new state?
CopyProperties inside the PlayerState
Thanks for that, I'll give it a go. I'll try to google it to see if I can see more info on it.
Anyone familiar with this error? "UActorChannel::ProcessBunch: New actor channel received non-open packet. "
Ok, my assumption is, this is C++ only and not in BP?
That is incorrect
I even did the PR to expose it :P
Just noticed, (Something I need to do more often) you can override the function. I for some reason keep forgetting about the override option.
The only problem I have encountered and heard about regarding broken replication after several travels is that the client fails to match the netguid
However I didn't see anything related to that in the post
Probably mostly on PlayFab forums or discord if they have one
What is it attached to
Skeletal mesh
I really need help with the structure of Saving Game I can't wrap my head around it. I need to save a variable that I can calculate from a Player Pawn and Load it back When player spawns. All this replicated for listen server setup. Now Idk where to do what. I've tried Load and Save with Game instance, but Clients get the server data for whatever reason or get nothing. INot sure what to do and can't find much on this topic online :2
If it's attached to the mesh then it shouldn't jitter, cause that one is smoothed. Hm.
You should clearly explain how your save and load system should function and what it needs to support.
Ok, I'm sorry to be a pain in the butt @thin stratus this is first for me (using player states, normally I would just use Game Instance for these things). How do I would I call for the previous player state when moving to a new level? If I have to use OnSwapPlayerControllers (I'm testing that right now) it doesn't give me the Old PC. Is this due to me using it within the editor?
idk why but it's jitter haha
If I recall correctly you need to enable seamless travel on the game modes for this
And that isn't testable in editor. There is a console command for it but that might crash
Hmm just have a local file from each player and use it to spawn the inventory. Ideally server would spawn the list of items provided by the player. (List that can be created from the player pawn)
OMG, I thought it was auto enabled! Thanks, I had a previous project that used seamless travel and I forgot I had to adjust it within GM. thank you
Not sure that's it but would be my first guess
Hm. So you need to tell the server the data via a Server RPC.
My first attempt would be:
- remove default pawn from GameMode
- In BeginPlay of PlayerController, check for IsLocalPlayerController and if that's true, load the data and call a SERVER RPC that passes the data to the Server. Then on the other side of the rpc, spawn the pawn and give it the passed over data
Can you point me to any documentation you think would be helpful with that issue?
That specific issue is probably best researched via discord search
Cause it came up a bunch of times and I posted about it
There is a console variable in newer versions that forces the guid to be synced again or so
Increase bandwidth but fixes that specific issue
Can't say if that's your problem though
wdym by removing pawn from game mode ? Also what would that be for ?
The DefaultPawnClass you might have set
Oh ok
Simply to stop the Game mode from automatically spawning the pawn
So you can do it by hand via the rpc
I've done that yeah already ahah
I don't have too much time cause I'm heading to bed now. But the second step should get you somewhere.
If not, post your code and explain your problem and someone will surely help
Thanks! I'll check that out. just in case it is related here are the other errors i am seeing
LogNetTraffic: Error: Received corrupted packet data with SequenceId: 30918 from server 3.145.62.200```
Okey well thanks anyhow, been all day trying to figure that out to no prevail :S
Na it should talk about failing to resolve or spawn from NetGUID iirc
Something like that at least
Can't promise it's just a Lyra bug and you either have to figure that out yourself or hope epic or some other Lyra person fixes it
Seems like most people that post use lyra
CreateSession node not working when steam overlay is present, any ideas?
LogOnlineSession: Warning: STEAM: Failed to initialize game server with Steam
yeah im using Lyra
hi guys, could someone explain to me whats the difference between player controller and local player controller? whats the difference?
Its so you can have online multiplayer games but also local multiplayer games that use splitscren or two people sharing the same keyboard with like a fighting game or something.
loading datatable this way is a good approach in a Multiplayer game?
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Data")
UDataTable* MyDataTable;
void LoadMyDataTable()
{
static ConstructorHelpers::FObjectFinder<UDataTable> DT_MyDataTable(TEXT("DataTable'/Game/Path/To/MyDataTable.MyDataTable'"));
if (DT_MyDataTable.Succeeded())
{
MyDataTable = DT_MyDataTable.Object;
if (MyDataTable)
{
TArray<FMyData*> TableData;
TableData = MyDataTable->GetAllRows<FMyData>();
for (FMyData* Row : TableData)
{
// Access data from each row
FString RowName = Row->Name;
int32 RowValue = Row->Value;
}
}
}
}
like tekken or no way out type of game right?
not sure about those but yea local controller 0 is the normal player and any other value would be for another local player
But its easy to make mistakes with online multiplayer games where you use local controller 0 instead of owning controller to do stuff and wonder why ALL of the players are doing the thing instead of just the one you want to.
I don't think -1 is valid value for a local player controller
oh like in widget right? for the owning player instead of using get player controller i would use get owning player? right?
It depends what you want to have happen but yea its a common mistake to use get player controller 0 instead of get owning player because they have different context so when you try to use them for some event logic you'll probably end up with an outcome you didn't expect or want.
You can read more about them here --> https://wizardcell.com/unreal/multiplayer-tips-and-tricks/#2-beware-of-getplayerxxx0-static-functions
thanks man ill look it up
yeah it makes sense now cos idk but lets say we have 1 player in session right, if we were to host it and then someone joins, is the player controller index 1 then? and then when some1 else join again now this guy's index is 2 and so on?
no the number with get player controller is for local multiplayer but it also depends where you call it from I think
If you call Get Player Controller (num) from a client then it referrers to local multiplayer aka splitscreen because other player controllers (remote) are not available, but if you were to call Get Player Controller (num) from the GameState it referrers to the index of connected players which can change overtime.
i mean well i need to educate on that, i pretty much fresh when it comes to mp, thanks for the responses Im also checking link rn
@wintry crane man of culture
Does anyone know how to disconnect the client who joined a host client because for me it only disconnects the host and frezzes whoever joined
its on a listening server
Hi. I want to destroy an actor but I need its state to be up to date on the client, so that the client plays the right destruction effect. Is there any nice replication mechanism to do this, or I must do something tedious like use an RPC for that? Thanks
You can call TearOff on the Actor before you destroy it on the Server. This causes it to close its Actor Channel (stop receiving net updates from the Server) without destroying the Actor.
Which allows you to then destroy it however you like on the Client.
IE: Play some nice effects and gracefully remove it locally.
Is that what you are after?
I don't think so?
My server code does this:
building->SetIsAbsorbed(true);
building->Destroy();
IsAbsorbed is replicated, I wanted the client to receive that before destroying. Kinda like a flush.
Call ForceNetUpdate() before the Destroy it might manage sending it in the same packet. You also might want to consider using SetLifeSpan(1.f) instead of Destroy
Can Actor has multiple NetOwner?
What do you mean by NetOwner?
An Actor only has 1 Owner.
testing...
I imagine the level that can interact many actors
but if actor has no owner, i can not call Server RPC in client(Right?)
i was thought method that enable all players to own actors easily but it looks like illegal.
how can i achieve that?
I'm sorry that my English level is low
This works:
if (building->GetLifeSpan() == 0)
{
SetHealth(Health + building->Health);
building->SetIsAbsorbed(true);
//building->Destroy();
building->ForceNetUpdate();
building->SetLifeSpan(0.01);
}
ForceNetUpdate alone wasn't sufficient.
I needed the lifespan if-test to prevent recursion.
It would be nice if Epic made a cleaner mechanism (like making ForceNetUpdate alone sufficient).
Thanks Matt!
Anybody using networked state machines? If so, what's your solution? Plugin? Custom? If not, what are you doing instead? A bunch of ifs? Some other pattern?
Using UObjects as part of an inventory system and it doesn’t replicate, if I just make a custom UObject class that does replicate will it fix the inventory system?
Containers are filled by a player, then when accessed by another player are always empty. They can locally access their own storage’s, i.e. they can fill up a container on their client’s machines, but it doesn’t replicate its contents (which is an array of UObjects). I’m told this is because the GetAllItems function returns nothing, because the UObjects can’t replicate. Does this sound correct to you guys or is there something obvious I’m missing?
@glad cloak UObjects dont support replication by default
Take a look at the 3rd Pinned Message in this channel
Ah perfect, was the exact website I was just looking at. When they say the Actor should always be the outer, what does that mean exactly? Like should it only be created from an Actor BP? Or should it be attached to an actor like an ActorComponent is?
Outer is just the Owner
So generally speaking when you try and replicate a UObject, it will be instantiated by an Actor, the Actor that will be its channel for replication.
Also with this screenshot, I have red underlines on a few things, do you know why?
If you are not using resharper then you can ignore the red lines
I would suggest getting a free trial if you haven't use one
Cool ty, so if I just get error code 6 (as UE5 project is currently open) its all fine?
Like I should only worry about compile errors
You can ignore the error window , on the bottom left there is error and output tab. Select the output tab and abandon the error window forever
Intellisense is broken for unreal project
@glad cloak if this is your first time compiling you probably want to tick some check list. There are featured enabled by default that can potentially break your project (I think it's hot reload)
More info
Gain months’ worth of Unreal C++ experience in a single article.
To my knowledge I have set up live coding and hence disabled hot reload, but I get these error messages from the above code in the output tab (which seem to be the same as the errors in the error tab).
In reference to this
@glad cloak I actually use rider so I am not that familiar, can you post the whole picture
It seems to me you are still looking at the error log
This is the build error log
For this code
For context, Im trying to make a "replicated UObject", im fairly new to cpp so bare with me
Is it something to do with the fact that my header file has that code and it (or parts of it) should be in my script file?
Or maybe i dont have the correct includes?
It definetly doesnt build tho, so those errors must be legit
You need to either forward declare the UMyReplicatedObject class:
class UMyReplicatedObject;
or include the UMyReplicatedObject header.
If you're not accessing the class and only referencing the class (which is what you usually do in header files), I found that forward declaring is fine. Can go just between your includes and your UCLASS()
Please move your function definitions to the cpp file so you don't include half the project and engine in a header file and cause circular includes
And then forward declare the object class like Datura said
GetLifetimeReplicatedProps doesn't need a declaration. You can just put the definition into the cpp file. The class macro declares it for you if you have replicated variables
do you know guys what comes first? check that the actor is in a relevant distance or check if actor has its update time?
if I want max server perf on my dedicated server, should I set NetServerMaxTickRate to very high? (like 120)
Il ask this here in multiplayer as well as cpp, but does anyone know what this error is?
have you tried to write some UE game in c++ in singleplayer mode? It seems you dont fully understand the concept of Header, Cpp file, type forwarding, definition, declaration, etc.. I dont think the way you try to learn stuff(means start from zero to MP title) is the best approach
and one last non asked advice - turn of Hotreload/Live coding for now since you are not able to recognize ATM what is an "real" error comes from a compiler and what is bunch of mismatch noise from Live coding
I'm trying using the string I get from IOnlineSessionPtr::GetResolvedConnectString as the URL for ClientTravel. Is this the correct order/way to join the host player world I joined through the sessions?
Nah, GEngine->Browse iirc
or the open ... console command where ... is your connection string
Hello everyone, I'm having trouble again with the saving of inventory and having another go. So here is my setup. What Happens with this is the following. Client when loading to Server doesn't get his items. Server does. This is on the player Controller
Now game loaded still get's called, however the value inside the save game seems to be null ptr
This is where the value is turning into Null
You shouldn't be able to send actors objects from clients to server, if object doesn't exist on server
How should I tackle this then ? I'm not sure
What I would do is storing the data in a struct, sending the struct to the server, letting server create the inventory actor/component from the given data, so it replicates to clients too, and then assign/attach it to wherever it needs to be
But how do I send the struc to Server ?
I'm so lost on this, been on it forever now
As a parameter on your server RPC
You can't send not (at least yet) replicated objects but can send raw types and structs
I think I get it
Okey I'll try something out, however does the struct is local Player only ? If you see what I mean
the data is coming from the local player savegame file
You might have been warned before but I'll repeat just in case, this is not a safe way to store inventory, clients can claim they have items they don't or send corrupted data, since you're storing the information on the client's save file
Yeah I don't mind cheating
It shoudn't matter where the struct is coming from
So Pawn gets value -> gives it to update struct -> Struct to RPC Server -> Job done ?
Depends on what you mean by value
References in your struct won't be passed to the server either
You need raw types
Like you can't send an array of actors, even in struct, to say that you have those items. But you can send classes and integers meaning how many you have for each item type, then spawn those items in server and assign the references to your inventory
Can this work ?
No
Ah, Client did spawn an item though lol
Sorry, I should be a bit more specific.... If the array you're feeding in contains objects that aren't assets, then it wouldn't work.
So If i'm already spawning items means it's fine right ?
No
ffs lol
A reference (the blue pins) can be replicated or not.
Assets can be referenced without requiring the assets to be replicated.
Anything spawned would have to be spawned by the server and be a valid reference on both the client and server to properly reference the specific instance of the object if you want to reference it across the network.
So like your save game itself, only would exist on the client, so you wouldn't be able to reference that save game object on the server (just as an example)
The save game contains a list of definitions
Data assets
Yea so that should work.
Ok great ahah pffiou
You wouldn't technically need a structure to send it.
😅
Yeah but Idk why without the struct no item spawned for the client
Now they do spawn
so that's something
It didn't work because you were trying to send refernece to the save game.
Now you're sending the referneces to the data assets within a structure. You could still just try sending the references to the data assets.
Okeyy hmm, thanks for the explanation, now I get error with the save file 🙂 this never ends aha
Hey, guys! Maybe this is a stupid question, but is there any way to create multiple sessions on a dedicated server?
General question : Why do people usually say that doing Multiplayer is way harder than Solo games ? What makes it difficult
@sinful tree @upbeat basin Thank you to both, made it work finally !!
There's more to think about. There's more involved to properly get players connected. You can't handle data the same way.
It's not like, flick switch and all of a sudden you can play multiplayer. If you don't build things with multiplayer in mind, you're basically going to have to at the very least look at everything and probably recode all of it.
things come to mind: optimization, cheating, replication, lag and sync
So I'm doing my first game ever and learning unreal for 4 months now and never deved anything. If my game was solo It would have taken me a whole lot less time, because with multiplayer you have to think about every possibility possible + how each player has the same thing etc etc. Solo, if it works it works kinda
with single player if it works it works, for multiplayer you need to be extremely mindful
could someone help me understand this, how does the engine know which function to call here if two are named the same?
(im trying to fix the red underline error)
It checks the amount of parameters and type of parameters
do they not both have 3 though?
like one is an ActorComponent and one is an Object
In this case I don't know as I'm not a c++ person but I know from another language that I learned, it was checking for the amount of parameters you provide and it tries to call that method with the same amount of parameters
I ask because here UMyReplicatedObject inherits from UObject, but when I build i get this error:
Error C2665 'UActorChannel::ReplicateSubobject': no overloaded function could convert all the argument types
pertaining to this:
your syntax is weird, what's this syombol for |= ?
others have suggested its because im missing something fundamental about pointers (entirely possible), but I just cant figure out why it doesnt work and everywhere I look suggests that "MyObject" doesnt inherit from a UObject class but it does?
that performs an OR operation between two operands and assigns the result to the left one
You haven't put the #include in the actor .cpp file for your object
I think you will get a better answer in #cpp
Also if you're following my (old) article, you're better off using Replicated Subobject list now
Then you don't need a special actor
How would it exist in the world then?
What I mean is, any actor can use it
You don't need to subclass AActor anymore to add your own replicated subobjects
Ok, is there good documentation on how to do that somewhere? (ideally another article like yours lol)
Awesome thank you
Also forgive my ignorance, but does this approach sound correct?
Im trying to make a "UObject" replicate and be used in an inventory system, and store and remember data when it is brought in and out of the inventory. So, it would need to be associated with an Actor that exists in the world, so using Replicated Subobject list is an approach to doing this?
Depends really. Moving a replicated object from one actor to another isn't straightforward or cheap. Replicated subobjects also have a non-negligible cost which presents problems at scale. Unless you reaaaaaaaaaally need them, I'd avoid it altogether.
It’s for relatively small scale, 4 player max, listen servers only. A player’s inventory is an array of UObjects, but I’m having issues replicating the inventories (such as containers/chests) between all the players
Basically a player can open a chest, put an item in it, and close the chest. When a second player opens the chest, it is empty, but can be populated with items by that player. Both players only see their own instance of the chest, it’s not replicated between them. Does replicating a UObject class and remaking those items with the replicated class sound like a correct approach? Or should I be using something like an item Struct in blueprints?
does MyActor->AttachToComponent() automatically replicates or do i need an RPC for that?
You shouldn't really need instanced objects for that.
What would you suggest? If I want to store data about an Actor, like a fuel tank’s current amount of fuel for example, I shouldn’t need a replicated UObject?
Does RPCs work on non player objects? example, a random barrel in the world?
im gonna say yes
is it possible to set static mesh foliage actors net dormancy?
Depends if the actor has owner and which RPC you're trying to send, considering actor is replicated
Multicast -> Would run on every player and server even without owner
Client & Server -> If owner is null, calls should be dropped, otherwise, should work as the player objects
My NetMulticast function does not work. on an actor in the world
the actor bReplicates = true;
I have send screen shots. the problem is that it is only being called in the server. its not being called in the client
well yeah, multi cast can only be called by server
Unreal use Server-client model
I called it in the server
replication only woork froom server to client
but its not being called in the client side. just the server
refer to this log
Is it called twice on the server? Or you tried it twice?
how do you print/log?
there are two actors
guys a question. I am making a blueprint factory in multiplayer where it adds negative states to the player such as bleeding poison, etc. I'm doing it with components. My parent component has an event in run on server where it is responsible for adding the state that I want to execute. I have each state as a component. Is there a way to synchronize this better for users so as not to only depend on the server to avoid lag in the game?
here
why is that even a multicast
Well the best answer to this is using GAS I believe, but if you want to keep your components and do it on your way, you would need to do your own prediction stuff somehow
i want to update the color of the actor on all clients during runtime
yes, and?
why is it a multicast
if it's based on TeamId changing, why isn't that just an OnRep?
because if its not a multicast, it will only update the color in the server
all clients will have a white color
here is the setup
my predictions I did very well with my fighting system. But with a system of adding and removing components that the server is in charge of, I see the blueprint as a bit confusing.
I'll just say it again
if it's based on TeamId changing, why isn't that just an OnRep?
because team id is not being changed during runtime. just editor time
here is what is happening basically
then why does it need replication at all
Team ID is being changed during editor time
I put two Flag Bases on the map
set FlagBase1's TeamID to 1 and FlagBase2's TeamID to 2
Hit play
FlagBase On Begin Play will evaluate Team ID on the server side
Server will call Update Team Color based on team id
Client Will call Update Team Color based on team ID
it needs replication so that client will also recieve the signal to update their colors
yeah you're still not explaining well why this needs replication
pretty much the data it needs will be there by the time BeginPlay fires
it needs replication because if there is no replication, clients base will always be white
theres a special data in lyra that i am waiting for. OnExperienceReady. that is why i want to call it in the server
And the reason why multicast "not working" on clients might be due to them not being even connected to the server yet, if it's running on the BeginPlay
ah the perils of making your game based on Lyra for some reason
Its being called after OnExperienceReady . which is seconds after the game starts
why doesn't the client listen to that delegate then?
Hello 👋
I got the following blueprint (BP_RPC), which I want to be executed on the client, but as you can see on the bottom left corner the server never received the RPC from the client, my BP_RPC has bReplicates to true, and I tried to use SetOwner(...) but the server never receive the RPC, do you have an idea why ?
this image clearly shows the server receiving the RPC
oh this is reverse order nvm
the output log will usually tell you why
Yes but it shows me nothing 🤷♂️
hi i do have small inventory system but there is a problem with client side.
whenever i loot,drop etc. i am updating my ui with a event dispatcher. then in my ui i am sending request to my player controller to get my all items array from inventory component with a custom server rpc. then send this data to my inventory ui to create item icons, amounts etc.
but if a client runs this logic its gets empty array in ui. it does add right item i can check it on my player controller or inventory component.
any idea to help this? i am a newbie in multiplayer sorry...
and this is why debugging networking in BP is annoying
I juste show you this as a blueprint but in fact I am using cpp
well if it was in C++ you could actually step through the RPC call on the client and see where the failure points are
I'll try that
any idea to when i run a server rpc to get a array then pass it to client rpc but its returns empty. why this array getting lost ?
guys i am planning to make a game with 2 players without split screen, should i make it so that there are 2 local players instead of 1 local and 1 player? which one is better?
Do you mean breakpointing the function call point or is there a better way here?
well yes, but actually stepping through what it actually does
if I want to execute something from the server to all clients, can I use the gamestate to communicate with the clients playerControllers?
I tried using multicast but the clients dont see it.
multicast should work because the gamestate is something always relevant
but if it's interacting with player controllers, you could always just... loop through them
so from server I can get access to all playerControllers?
through the gamestate
still would like to know why multicast didnt work though
a multicast on what
I create the custom event inside the gameState and I try to talk to all playerControllers
maybe Im doing it wrong
are you going to show it or was the issue it wasn't being called at all?
but of course you can get all controllers server side
Any networked movement experts free to sanity check me? Having issues with net corrections during root motion.
I'm working on an ability that causes the character to charge forward. An animation plays, and then a custom root motion source (RMS) activates partway through the animation to handle movement. The RMS is custom as I want to give the player the ability to steer this charge movment. I wrapped the RMS in an ability task that feeds it a new force direction on tick based on character facing. Finally, there's another layer in the form of an anim notify that overrides the character's rotation rate. This rotation rate override is captured in the CMC saved move system.
The character gets net corrected heavily the moment I start trying to steer the movement (30-60ms ping). The charge movement is pretty fast (~2000 strength in the RMS), so I thought that could be part of the issue, but I'm still seeing corrections when I reduce the charge speed. With the low ping I'm leaning more towards the ability task is getting diverging rotations between the server and the client due to desync between the RMS and the CMC's saved move system, and what I see in my logs supports that theory.
I'm thinking I need to toss out the RMS and rebuild the movement in a custom move mode in the CMC, but I wanted a sanity check before throwing that away.
you could do it through overriding the PhysCustom function in the CMC, but you'd have to handle the movement manually.. might be tricky if you still want it to respect if you're on the ground or falling ect
I kinda figured something like that. Am hoping to get by with "basically PhysWalking but always forward"
actor component always should be replicated?
i have some replicated variables in this component
and it works, but i don't know if i should also set this component to replicated?
yep
Not sure if this is where its best to ask but, If I have a variable on a player controller and want to send that to other clients on the session. How can I do this?
I thought about calling an event on the game mode that's replicated but the client doesn't have access to the game mode right?
You'd want that variable on PlayerState
So I use start/finish recording output to save a wav file, convert that wav into an array of bytes and assign it to the variable on the PlayerState which will have it available to all the other clients to convert back into a wav file. Would that work?
Depending on the size of the wav file, that might not work
Might be too big
So you'd need to use RPCs and chunk the data
Ok so that's what I was reading and understood but I'm not sure how to use RPCs for this situation
My understanding was have an event thats replicated with Run on owning client and make sure its not on the game mode since it can't be accessed by the client, only the server can access it.
Am I correct?
Correct the clients don't access the gamemode. You can send values/chunks using RPCs. Would go like this, client Playercontroller->send value to run on server RPC that runs on server instance of the same playercontroller. Then the server playercontroller accesses gamemode (not an RPC both already on server) and calls a function/event that receives the data and then passes it to each player controller in the game by calling a run on owning client RPC for each player controller.
OR you can find a way to make it a replicated property possibly and let replication send it to the other clients
does any one knows a good way to prevent multiple calls on Multicast events
so if I called a Multicast event that called a second Multicast event, how to make the second runs only from the first client?
That sounds like a terrible approach to begin with. You shouldnt call a Multicast inside a Multicast, there is no point.
Since the Server will effectively end up producing 2 multicasts
Which is wasteful and potentially problematic.
I know that, but I want a way that's built in each multicast event, in case the code did run a multicast from a multicast
You can call the *_Implementation directly instead of the actual Multicast function if you dont want it to trigger as a Multicast
UFUNCTION(NetMulticast)
void MyMulticastFunction1();
UFUNCTION(NetMulticast)
void MyMulticastFunction2();
void MyMulticastFunction1_Implementation()
{
MyMulticastFunction2_Implementation(); // This wont trigger the Multicast RPC, it will only execute is contents.
}
void MyMulticastFunction2_Implementation()
{
// Some stuff.
}
Instead of
I'm using Blueprints right now
void MyMulticastFunction1_Implementation()
{
MyMulticastFunction2(); // This will trigger a Multicast RPC
}
Oh
Well youre out of luck
Blueprint doesnt give you that type of control
You can create a function that is the body of the Multicast and call that instead
Which is effectively what is happening in the code I posted above
I managed to get a way like that, but it got one Issue, If I called "SecondCall" from a client directly it won't fire
yeah
So calling SecondCall on a Client will do nothing
What on earth are you trying to achieve here?
Hello guys! If someone has a idea on where start looking at, we have a dedicated server that when run on Test release after sometime kicks all the players and keeps running like nothing even happened, no crash, no logs, no sh*t...
Did it perform a Level Transition without SeamlessTravel enabled?
I run multiple instances with one map each, it doesn't change levels.
I want to prevent the multiple calls, in case that happened, I'm working on a weapon system and I don't want if the character did a multicast event to ruin things in the weapon system of what it should do
and the weirdest thing, the log says absolutly nothing! It doesn't show even the player disconnections.
Sounds like it crashed
I tough so, but the ctrl+c working kinda disconcert me..
and never ever of all the times it happened, got a crash traceback
did you find fix for this has anyone found fix to this. im having same issue
any idea on what to debug? or what may be causing something like this?
Without logs or anything I cant really recommend anything specific unfortunately.
yeah, just where I'm standing haha, idk, its super weird, I don't know even if itsn't the DSS system we are using, that launches another server (because supposedly the other one crashed) and rebinds the udp port..
Well that would be where I would start
yeah, I was thinking on that.. gonna try to figure that out..
Multicast events should be non stateful anyway. Like play a sound or montage or particle effects. Replicating state should be done through onrep properties
Or rpc I guess if you really want to
ok so, no the problem is not rebinding, the DS stays on, but players can't connect
also SeamlessTravel is disabled
since it's not implemented
but we do use WorldPartition
You should enable Seamless Travel if you intend to transition levels and want connected Clients to remain in the Server.
Having it disabled will cause the server to forcefully disconnect all Clients when a level transition occurs.
even if the client is being redirected to another server?
because I have each DS intance with each map
DS instances don't change his map
A Client connecting to a different server is a local operation
It wouldnt affect the server they are already on (other than to say they would be disconnected when moving to a different Server)
Make sure you are doing that transition correctly though
If you are accidentally causing the Server to try and travel instead
Might be part of the issue
yeah, I don't think that's the issue, because players are traveling between servers just fine.. I will check dungeons instances anyway, just in case
I'd love to know what went wrong in the end cz I'm with a very similar setup, just in case I also run into this in the future. Even tho it's probly a project specific issue, I'd appreciate if you pinged me when you have an update 👍