#multiplayer
1 messages · Page 176 of 1
in c++ have you to call it manually (on the server)
Thank you
I would, but I'm on the edge on it being actually full ends correct
One thing for example is the Independent Tick part
It's more reasonable to use FixedTick and add the Smoothing
And other implementation details like Crouching being a LayeredMove.
We aren't doing that internally, which either means there are multiple ways, or one of the two is less ideal
And there is some more stuff that I find lacking.
- ProposedMove isn't fully set (bHasDirIntent for example isn't properly set)
- MoveInput should already be WorldSpace (old Engine version?)
- Pretty sure Jumping, similar to Teleport should refund RemainingMs
- Some Variable Types are set to 3d instead of just using the correct FVector etc. type
- MovementUtils seem to be jamming multiple MovementModes into single functions (scales badly)
While I value resources like this, I don't see where it is worth more than the existing examples that Epic provides.
I gladly pin it if the repo is cleaned up, updated to latest 5.4 Mover code and if it holds some more information about the Tick and Smoothing part.
I personally had a better time following Snaps code than epic's for what its worth, its simpler, less cumbersome to follow. And also, its customly built from the ground up, can help peeps to do their own implementations easier.
Now, we are not 100% sure if its the right way to go, as there's no public info about some of the topics:
- Regarding the Tick/Smoothing, ye not sure.... epic hasn't pronounced themselves about it either! so... ye idk
- Regarding the layered moves... I also implemented sprint doing this and so far... doesnt look too sus 🤷♂️ Ay would love to ask J. Hare himself what would he do hahaha XD
Although this is a nice list of feedback, will forward it to her! Thanks exi, lets see if I can help her a bit to solidify it as a community sample
I have setup a nameplate system for players.
according to this flow show in the points,
- I have a player name veraibale is replicated using on_rep.
- Name is setting from Widget through player controller
- Name widget is setting in player character class
The code working for the player who are joining togather but those player who join the game late do not have the name for all the players joined before it's joining.
help me fix this issue.
thanks in advance
We are using Mover for a bigger game at the moment and have quit a lot of typical movement modes already implemented. Just in case you wish to know where my points come from.
Including using FixedTick
ye I figured u had ur own rodeo haha :>
But at the same time exi i think the existing examples of epic fall a bit short and arent very pedagogical to show u how to implement ur own thing, thats where i see the value. Lets see if we can clear out these points 🙇
Yeah I happily pin it when the repo gets cleaned up.
More comments, less debug code, more commitment to the implementation, no unused files, fixing of bugs and missing code (like bHasDirIntent), and maybe some more info in the readme in general.
Right now it feels like a quickly thrown together snippet that isn't maintained
hey sorry for the late response i fell asleep after that message lol. I did not need to open any ports on my router or do any extra stuff with it. All i did was download the steam subsystem with unreal, set up servers creating/ joining, make sure you have steam open prior to running the EXE and it should work
Hello i'm facing an issue regargind local mutliplayers. I can play with 4 players. so each players has it's own camera.. so then it's a big issue for the FPS and the performance of the game. Do you have any tips or solution that i should considere to be able to have a game 100% functional with 4 camera?
Familiarize yourself with Profiling Tools to identify where your performance issue is coming from would be the best advice in that situation
building servers gives an error "Unable to build while Live Coding is active. Exit the editor and game, or press Ctrl+Alt+F11 if iterating on code in the editor or game"
PDAs arent replicated, but are they at least still valid on server ?
They work identical to any other asset. Like a texture or a mesh. They are net addressable. You can replicate a pointer or rpc a pointer to them. And they are loaded on whatever machine has them loaded.
I use independent tick currently because Epic hasn't yet shown they are committing to fixed tick, even their examples don't do their own interpolation so i'm assuming Epic is also using independent internally. Since I haven't seen any inclination yet of how Epic plans to use this I didn't bother to implement it on fixed tick, after all fixed tick was an NPP feature that was highly work in progress for a long time even before Mover.
Re crouching being a layered move, you can find examples of Epic doing similar and it lets you make usage of transitions.
- Yeap fair enough on ProposedMove.
- MoveInput was defaultly not in WS on older versions, they did some breaking changes towards end of 5.4 release
- Jumping doesn't need to refund the remaining MS because you still perform the move for that frame even if you jump
- Yea fair enough on using templated vector type
- This was actually intentional, but yea I suppose it doesn't hurt to break them apart for flexibility
As for what it offers over default example samples - those are afaik built on top of the ported CMC implementation, they aren't ground up and none of them are first person implementations.
hello guys! a few days ago i posted this question regarding a problem with rpc, basically, i wanted a replicated actor to make a small animation when a player approaches and presses "E", but it didnt work for the rest of the clients, i did what they recommended me and put an event on the server, and make that event call a multicast that performs the action for the animation.
now the thing works, but only when im playing on the standalone server,and this frustrates me, because i have a feeling that i have done things with rpc before that worked perfectly without multicasts or several functions
this is the bp that i currently have after the changes, i tried changing where does the function executes, and even linking the E key to both the server and the client functions, to no avail
what i am missing or what i am doing wrong?
Your issue is that you are not respecting ownership.
To make a ServerRPC, the actor or component on said actor making the RPC is required to be owned by the player. This needs to be set both on the client and on the server. This is normally set on both simply by setting it on the server as this is a replicated property.
Your Powerup is not owned by anyone.
So to get around this, what normally happens is that your Pawn or similar would have an RPC on it for a general Interact. You'd pass the actor reference through the RPC and call an interface function on the thing that would do what you need it to do one the server which then it can replicate or multicast whatever to everyone.
Fwiw Epic is in general not using Mover or NPP yet afaik.
so, basically, the act of trying to put the input inside the powerup is what is causing me all this trouble? and i should put the general interaction on the player?
For fixed tick you "only" need to add the smoothing for the owning client/autonomous proxy. Rest works fine.
This does currently need one to expose the FixTickTime or whatever it is called on the Manager. But mentioning seems reasonable at least
The jumping part I don't quite see. Jumping is a layered move and iirc even epic refunds the Ms, cause the jump is not part of the actual walking move anymore
Pretty much. One thing I would recommend is checking out the RPC chart halfway down this. https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Actors/RPCs/
It clarifies what happens to an RPC based on which RPC type it is, ran on what type of ownership the actor has, and which type of machine(server/client) it's ran on.
But implementation may differ. Over all I just think the repo needs a clearer setup to serve as a good resource.
Again I gladly pin it if you clean it up a bit
No worries
got it, also, just out of curiosity... why does an actor needs to be owned by the player to make a server rpc? wouldnt that just be restrictive?
It is restrictive and on purpose. It's meant to signify that this player has ownership over the actor and that they're allowed to use it. You don't want Player2 to shoot Player3's rocket launcher.
There are ways around it if you reeeeeeally want to get fucky with netcode. But quite honestly it's not worth it and you should just make a nice interaction system.
its funny because the way i was trying to make an "ownership system" for the powerup, is the same way that i would make an interaction if this was a single player, with collision boxes and stuff
Yeah, tbf it's rare that you enable input on generic actors. It's usually more of a very specific reason. Interactions are usually done by picking the best target for the player. Usually via line trace or through an overlap gather and filter. Reasons for this are also because this system can be much easier displayed to UI. There isn't issues with multiple actors fighting to show their stuff in UI when only one system controls what is the current interact target. Place the interact system on the playercontroller or pawn and that system can also RPC for you to do server interactions on the target.
yeah i know it was a weird move, my line of thought was that it was better for each actor to handle their own inputs, because i tried to use an event dispatcher to get this done at it was giving me the same problem
anyway, i will probably be back here after changing the interaction system, this thing has been a real pain to fix because i still struggle with bp comunication and how things work with client-server-client replication
i feel really bad when i have to come here after trying tons of stuff because i feel like i cant fix this things on my own even if my life depends on it
Thoughts on it compared to the good ol' CMC? (I already know Snaps thoughts 😅)
Hm, ultimately, I would just say this: If you don't need a FixedTick solution that ties together multiple NPP Simulations right about now, then Mover is probably not worth looking into yet. CMC is most likely superior in Bandwidth and Performance. NPP itself seems in maintenance mode, so that's not so great. Mover is a solid base, but needs work. They are working on it though I guess.
You can do a lot with Mover and you can probably reproduce whatever CMC Movement Modes you had in Mover just fine.
But if you want this to have other NPP simulations tie into your Movement, you would need to use FixedTick and that lacks smoothing. While adding smoothing is relatively simple, it needs changes to the plugin.
Even without FixedTick, corrections aren't smoothed either.
There is still a lot that needs to be done to have it work really nicely out of the box for all users, especially Blueprint users. And there doesn't seem to be a big focus on that for Epic at the moment.
So if you really need to tie, idk, your Weapon System to your Movement, or your custom GAS to your Movement etc., then sure go for it, but be aware that you'd need to use Fixed Tick and add the smoothing
IndependentTick only reconciles the simulation instance that got corrected
I think Mover should go through some more iterations and QOL updates
And yes, it's a lot of negative points, but I think those are the more important ones.
I think the main thing stopping me from actively suggesting to use it over CMC is the lack of support from Epic and the current state of it based on that, together with the look into the future of how quick improvements may come.
If I see more Mover/NPP changes on main or in the patch notes then that would be great
And I say all of that while I'm helping moving the whole movement system from my Client over to NPP, so they can use it together with all their other systems that are moved to use NPP with FixedTick so we have a straight forward way to have the game systems rely on each other :D
On the other side there's the new net-physics stuff, which has improved a lot lately. Actively used in Lego.. in fact in the talk itself epic mentioned that they had to hack something together in the cmc to make their character work in conjunction with these physics because mover wasnt ready by then
Hello, I have a realy Big Problem with Repclicate Static Mesh Instances.
I have a BP with several Static Mehs Instace Components for Diferent Trees
and a Startup Event stat collects Transforms for these Instances and take them in a array
https://blueprintue.com/blueprint/knnjra1r/
this array is rep notifying and replicate these trees to the Clients.
with a small amount of instances like 300 or so it works. But i have much of these BP on my map and it dont work up to 30.000 instances
is there a better way? or some settings do do this ?
Hey everyone, I'm currently learning about replication and put together a small test. It's a clock that can be sent one of four positions, and then rotates from there on the client side.
I've noticed that when my Pick Random Time event picks the same number, it runs the OnRep_ClockPosition function on the server, but not the client. On the client the clock hand continues to rotate, but on the server it goes back to the picked position and rotates from there causing a sync issue.
What's the correct way to handle this? Should I be instead sending the final rotation value through? Seems a bit excessive for something that could be handled client side and remain correct.
For starts, even outside of multiplayer, your arrow is moving in a way that is not correctly framerate independent. Someone at 30fps will have a slower clock than someone at 60fps.
Even if you fix that though you can still end up with an out of sync client if they late join due to that join setting their clock rotation while others will have already been rotating.
If you're interested in precision I would recommend setting two states in like a struct. One being the random placement. The other being the time it was set. Your Gamestate has a replicated time offset you can use to relatively sync clients to a time value. This would let you use the difference of the time it was set to the current time from the gamestate to set the hand in the correct position while replicating the least amount of data. This ignores the FPS issue due to simply moving to the correct spot each frame and is resistant to late join issues.
Ah cool, I heard that structs can be a good way of bundling up data. Also thanks for pointing out the time thing because that's given me a new way to think of things.
In my game there are towers which will rotate to point at a selected target. I feel like that would be a good case to constantly send rotation orders so everything matches up. Is there a different way I should approach this?
@thin stratus Hey, i got super busy in the past few weeks i didn't get the chance to do this. i got to it this weekend so here's the repo https://github.com/TrueKaizoku/UnrealEngineNPP/tree/5.4-With-NPP-Features . this is a fork of the engine with smoothing added to network prediction as it was intended (2 services for fixed and independent) . intending to add few more improvements and features before calling it a day. i also made the changes to mover to make it work with smoothing fully.
Might need to separate the subtract function into get offset and apply offset to make it clearer what is called exactly and when .but with this fixed tick is fully implemented and can be used without any issue for any simulation , as long as it implements the needed function in the sync/aux state and the Finalize Smoothing in the driver.
Not sure without specifics. Depending on the case, it can either be replicated authoritively or simulated on the clients via simply replicating the target actor pointer.
any tips for testing a Windows PIE client against a linux server running locally in wsl?
i used to just call open 127.0.0.1:7777 to connect locally before but I guess the wsl side has it's own network stack and IP. I tried the IP in wsl hostname -i and that didn't work either.
I must be missing some configuration or detail, but not sure what to look at from here.
Awesome work. Very appreciated.
Probably only works if you are logged into an account that is connected to ue
I'm connected tho
nevermind, if anyone is wondering, you use the eth IP from ifconfig and it works
https://www.unrealengine.com/en-US/ue-on-github you need to connect your epic account to github account to have access to the Unreal engine repository. without it you can't see forks the repo either.
Does epic have any projects to help understand how RPCs work?
I don't think there are any specifically for that
Does anyone know why Mover movement samples have so much stuttering? Is there a setting I forgot to turn on?
Yeah some default settings for NPP
https://www.youtube.com/watch?v=KsORRtBOJYc&t=1323s
It's not an example and it's not my favorite style of presentation but this video is what made the most sense to me
📹 Part 4 of our replication series unlocks limitless potential with Multicast and RepNotify! In this video, we dive deeper about how Unreal Engine's Actor Replication really works as well as introduce ourselves to a variable replication and how combining the power of variable replication with an event driven design can help us build a multiplaye...
Did you read the compendium?
Mainly asking to know if that is not enough
already done
can you resend the link or I don't know why it doesn't work
can you access this? https://github.com/EpicGames/UnrealEngine/tree/release?
no..
then you don't have everything setup. that is the engine repo. i would double check if the github account you are trying to open the links from is the same one linked to your epic account.
this is valid
https://github.com/daftsoftware/FGMovement?tab=readme-ov-file#important-notices (for starters, although currently exploring alternatives [fixed tick - thanks SirKai!!!!])
Is it just broken
Yeah, I've read through it 3 times now. I understand the concepts but implementing it screws me up. I keep coming back to it hoping something will click.
Thanks, I already turned on two other settings but it was still stuttering. I'll try this now
you can try redoing the github account connection maybe. but once you accept the email invitation it would work. possible you did it a while ago and didn't accept the invite. which is valid for 7 days only. yo ucan confirm whether yo uare in on not by looking at your github profile under your name there is the list of organizations you are part of. Epic Games should be there.
I did it 20 mins ago and didnt check my emails
you got 7 days
lol ok thx
to set bOnlyAllowAutonomousTickPose to false do anyone know if they fixed this in Ue 5 ?
or is tere a way to toggle this in editor now ?
Are you locked into using BP exclusively?
it would be super easy to just create a node yourself
well no but i only do it ive done it in cpp before but i need guidance then x)
i just drag n drop it ?
is your project blueprint only?
no
Then you can just drag/drop it into <YourProject>/Source/<Module>/CharacterMovementLibrary.h
recompile
ah y
You can just print string "GetAutonomousPose"
and then set it
and then get it again and see if it changes
has anyone been using mover 2.0 in ue 5.4? curious if its got any hype to it for multiplayer movement solutions
yeah I just exposed a function that allows your to change it
The default value is not changed
We have it set up with lyra in 5.4 with some nice movement stuffs. Fully networked. Replays currently don't work with NPP, though.
oh ok
hmm icant find it
you set it up inside of lyra, or lyra is using it in 5.4 ver?
and what are replays?
probably need to compile it then
hm ok how do i compile ?
Demos?
We have it working in 5.4 with lyra (freshly installed from 5.4) with both the lyracharacter and lyrapawn.
It does not come with lyra by default.
lol still not following
that's dope tho, do you feel it's "better" than cmc for mp?
It's a lot lighter.
You record what you're doing in game and play it back later. Hence "replays".
Something people have forgotten about if they're born this millennium, apparently.
@gilded vaporhow do i comile* 😛
lookup converting blueprint to C++ project
aye it already is a c+++
even if your project is already c++ it will tell you how to compile
sick, i want to try it out but don't want to replace the current one, i just feel it's gonna be a hassle but when it's out of expereimental i'd 100 percent just go for the switch
base cmc just too limited
w/o cpp, and i only be using bps cause noob
Mover isn't going to be any better.
i thought it was supposed to be better for network replication
It's more generic and well built.
@gilded vapor hm i have 2x different .sln files in my folder is that wrong :/?
i renamed my project a while ago
well one of them is probs for your project
shooter royal is the old name
oh ok
right click on your project -> generate project files
well built, as in... better than the cmc??????
hm still dont have it :/
I think in principle, yes.
but no better for network replicated movement stuff? i.e. like a dash
or basic sprint
Different.
@gilded vapori dont get it im rebuilding doing all that but the file isent creating a c++ file from it
but not any better for client prediciton
building isn't going to create a C++ from?
Better in that it's easier to work with?
Do you mean a .cpp file?
yeah
its a standalone header it doesn't need a cpp file
oh
lol im just talkinga bout simply replicated movement related things. like if i wanted to replicate sprinting or a dash, would it perform better under latent enoirnment VS base cmc
@gilded vapor hm ok so i still cant find it, i need to be any specific class or something or am i missing something ?
oh found it
im dumb
lel
cool ty!
is that being replicated or do i need to run it on server or rpc the change also ?
It looks like live coding is breaking my dedicated server. What can I do about it?
Don't use live coding then. Turn it on, so you can't hot reload, but don't bother with it.
Enable Livecoding, Disable Reinstancing.
not replicated, it just exposes the bool 🙂
So, currently the biggest benefit of using Mover/NPP is so we have a singular prediction system, in which different gameplay systems (movement, abilities...) can interact with each other more easily.
Conversly, methods like using CMC or Mover with GAS, result in having multiple prediction systems, where potential interop will be a problem.
What I'd like to know, since I'm lacking experience to tell, is what would be some concrete common examples of such interop problems. For example, is simple stuff like sprinting or slowing abilities already problematic? The logic for these would probably be implemented as bWantsTo flags in CMC getting set by GAS lets say. I haven't noticed any problems when working this way.
Maybe the problems only start when we want attributes to be used/shared by multiple systems? Like stamina for sprinting between GAS and CMC.
I would love to hear more concrete examples of where any of you guys ran into issues, and how you worked around them.
Interop isn't really the main benefit of mover. If you need GAS (which solves an entirely different problem than NPP, even if it includes some prediction functionality) then you need GAS - and the issues you will have integrating it with mover are going to be similar to with CMC.
Eventually if GAS prediction is rewritten to take advantage of NPP then things might be different. But either way, the main benefit of mover is flexibility - CMC was/is a very rigid and annoying to use framework if you needed to do anything outside of the basic movement modes.
How much work would it be for you to maybe outline the exact change you did? Not sure how straightforward it is to search and spot all the modifications.
I know you have a readme, but for a team that can't use the 5.4 custom engine (cause they have their own), is there something to make it a bit simpler?
We for example also aren't on 5.4, so just comparing the NPP Source might not work
Theoretically anything inside a predicted GA that affects Movement will be a problem.
In terms of interop problems, it's mostly around GAS having its own state that it manages which is completely disconnected from Mover/CMC.
For example, CMC has a "wants to crouch" flag it sends over the network from client to server. If you make a crouch ability in GAS that sets the flag, you now have two separate systems saying "I want to crouch". And those systems could disagree - if GAS rejects activation of the ability on the server you now need to roll back state in CMC in case it already started moving with the crouch. If you try to protect against this by having CMC check with GAS on the server then you run the risk of introducing further mispredictions because CMC cannot roll back the state of GAS to see if crouching was allowed at the time the client sent it.
One solution is to avoid GAS driving movement at all. Let CMC report movement modes to GAS (with loose tags, for example) and query for active abilities based on tags to cancel them. Basically emulate what a real ability would do in terms of cancelling other abilities/applying tags but without actually using an ability. Let CMC be fully authoritative over its own state, and GAS just gets to look at the result of movement via tags without being able to directly affect them.
There are some exceptions, like RootMotionSources
Or RootMotion Montages in general
But if you alter e.g. MovementSpeed via a GE in any kind of way, you gonna run into corrections one way or another
And we are only talking about predicted stuff
If it#s something set from outside then that's always gonna be a correction of course
An enemy stunning you will lead to a correction, but that's normal
So "only" predicted actions that affect movement
E.g. if you have AimDownSight that slows you while aiming and you predict this outside of CMC/NPP, you will most likely run into corrections
You'd need to thunnel it all through CMC's ServerRPC, which people have done in the past
Or use NPP for your other system so that everything runs through the same ProduceInput and SimTick stuff
Which of course doesn't allow GAS then
You may also come up with an inbetween NPP system
That allows the client to predict any kind of value change for ~RTT
Server trusts for that amount of time
And if the value is not the same after that time, client probably did something wrong
But that's nasty and if you go with NPP you should turn everything into NPP systems that need prediction
Thanks for the great replies, you've cleared this up for me completely!!
I also worded that poorly, clearly the biggest benefit of Mover is the advantages it offers vs CMC (flexibility, modularity...). But another huge potential benefit is that it uses NPP, which we can use as the prediction system for other stuff we make too.
If you decide to write your own GAS to have a clean solution for movement influencing abilities, it would probably be easier to do so on top of NPP, as opposed to rolling your own prediction system, or hacking the entire thing into CMC.
Now lets just hope Epic decides to invest seriously into NPP/Mover for the future, 🤞for GAS 2.0 to be integrated as well 😂
It’s this issue that for the GMC movement plug-in there is now a GAS “equilivant” addon that integrates directly into GMC, so that everything is handled inside the one prediction ecosystem. And then you can extend your own custom predictions from it etc.
Hello,
So, I heard that you can replicate a pointer, i would like to know how this is done.
The main goal behind this is that i want to replicated a pointer to a UObject
Hello, I have an issue wit the host player.
I have this AttributeEvents ActorComponent on my player, which broadcasts a delegate where a widget listen for to update over head health/mana bars.
I Initialize this OnRep_PlayerState for clients, it works fine, it gets the widget, sets the "WidgetController" which triggers various event and let widget bind to AttributeEvents' delegates.
But for the Host Player, OnRep_PlayerState doesn't get called. I assume it's because host is the server so no replication is needed. But when i try to get the widget in InitAbilityActorInfo, the widget is null becasue it's a server and i cannot set "WidgetController" on it. so widget don't listen, and i can't get the widget to assign it.
Is there any way to make this work?, or do i need to call a multicast from the server and do all these in the RPC to make it work for everybody. But it seems wasteful to send an RPC to make thing work on the server player.
Thanks!
I would argue that if you just want to replace CMC, Mover might still be a bit behind. If you have the time to wait on Epic fixing it up, or you can patch the parts that aren't fully working yet, then go for it.
Otherwise, I would probably suggest using the CMC, as it might be more performant (haven't benchmarked it yet though) and generally more battletested.
But again, you can do probably all the Movement stuff with Mover (in C++). It just depends a bit on your requirements.
The NPP plugin has no changes in 5.4. So changes would be the same. I can write down the changes. But you can't see them in repo history? At least NPP is for sure same for a while.
I haven't checked yet. I have other tasks currently and I don't know if the team is interested in looking into this given we have the SmoothingComponent solution for now.
Is it just all one commit that adds the changes?
39db27063a0d162bdef77af3b1a7e29959ad485a?
NPP changes look relatively straight forward. More or less what I imagined them to be after our last talk
Yes, except the many times i updates the Read me 😅. All in 1 commit. Will be doing some more changes. But it functions same way as the smoothing component from before. Just as a service so it does smoothing on the entire sync state.
Basically just a new Service for either of the Tick Types that has an Update and a Finalize function.
Some new Driver functions so we can listen to that stuff in the Driver (LiaisonComp for Mover).
And then calling those next to the other tick and finialize calls
Makes sense
Sad that this isn't there by default. Doesn't look like something they couldn't add in a day or two of work
Probably half a day if it's your own system, but well
Yeah NPP changes are simple . Add service, register it and call it in manager.
It's not too much. But i assume the devs working on mover are not that deep in tbe NPP plugin yet. My guess they will do smoother for mover rather than adding a service.
Considered a pull request?
Even if they deny it, they might use it to speed up adding these features to NPP
I know it's a lot of time/effort needed for this stuff, just wondering
After i finish some of the other things i mentioned in read me.
Alrighty
Do I understand correctly that the NPP + Mover changes in that commit mimic the SmoothingComponent setup?
The Mover changes look like it at least
It's same logic
- including BasedMovement stuff, which I think the SmoothComp didn't have
At least mine doesn't
Get state diff and blend out the offset for correction.
Smoothing comp did have something for based movement too. Just offsetting the target and last structs saved. Just like i do in servic
Ah right, there was this extra callback for BasedMove
NetworkPredictionProxy.ReadSyncState<FMoverSyncState>() here you added the ReadType. Is that using some default value in the 5.4 version?
(don't have the Engine at hand atm)
The read type is actually an input in the original NPP function mover calls. But mover doesn't use that input , because up until now the "presentation" state was not valid for those ticking simulation so read automatically read simulation.. but after my changes presentation state is valid , so need to make sure we read correct state
So yes It was using Presentation as default value in engine version
so read automatically read simulation..
So yes It was using Presentation as default value in engine version
You mean Simulation I assume :P
Thanks for explaining, that makes sense. Thanks for sharing, this is probably a huge thing for everyone who wants to use NPP (and Mover) with FixedTick
So input to function was presentation by default. Function itself check if input is presentation and presentation was not valid it returns simulation. Whoch was happening until now. But now presentation state is valid so the validity check will pass and will return presentation by default. Not what we want.
Very welcome. I will try to get it as feature complete as possible.
Ah, alright
Is there any git repo with sas and eos inbuilt Template with pubg like lobby system ?
Hello, everyone! I have a question: If I spawn replicated actor on server. That Actor has some replicated properties. If I will set these properties on the server in the same tick as Actor is spawned, will they always arrive in the same bunch on Client, or they could arrive in different bunches?
Don't worry, I've already got that from reading through most of your previous messages relating to Mover 😉
I'm still gonna dive into Mover though, since my plans for the future involve complex movement influenced by weapons and abilities, and potentially physics interactions too.
Also because I'm still in the research/tech demo stages, so I want to try it out. Especially if it ends up being the more future proof approach.
Yeah that's totally fine. (:
I think that it's correct to say that the data will be available on BeginPlay on the Client
Not sure if you want to spawn it deferred for that though
but is it like 100% true? If there will be a really huge traffic bottleneck and mb some different prioritizations levels for replication, It seems that It is possible to not have all set properties to be replicated on BeginPlay of the actor on client, or am I just too paranoid? 😄
I think it's 100% true, cause the replication stuff happens at the end of the frame, so it would send any changes you did to the Actor.
But this is one of those things that I somewhat accepted and never actually looked into :D
I just do not want to write logic, which I can't be 100% sure of. I might look into the engine code myself, just do not have time for it right time, thought that mb someone knows the answer. Anyway, in any case I can rewrite it another way, to make sure everything is replicated correctly, just was really curious about the case :-).
Thx for the answer! If anyone can 100% prove that such replication will work on client as was said, I'd appreciate the help! Or at least if Epic somewhere says something about it.
From my experience, I would never rely on something like that being always true 100% as there might be some combinations of cases when that spawned actor's properties become of a lesser priority for the network, or the other side of it would be making that actor always be in front of the priority queue in comparison to everything else in your game. But then, does that fit your game use case; can you allow that? And is that actor ever irrelevant to someone else for some other reasons? Do all clients need to have its' properties available or just the client that spawns it? I would try to answer such questions first before I code some sort of a universal 100% solution (as in assuming that its' properties will always be there right away).
well, in my case, I have only server and owning client, no other client are involved, but yeah, I agree that it is better not to believe that in such case everything will be 100% true, Unless you checked the engine code and know all the possible cases.
With networking, the code can even be solid and work perfectly 99% of the time, but then over internet there can be a case where your data just isn't there on that first frame. So, depends on your use case etc. eXI is right, of course.:)
To be fair, the thing in question can probably be 100% true
Cause the question is if UE sends the updated Variables of a newly Spawned Actor to the Client if they are set in the same frame.
And there won't be a 50/50 chance
Either it does or it doesn't.
What if the data of that spawned actor does not fit into the packet that frame?
Or am I thinking in some archaic terms and this is something that just works in UE? Cause I've written my own networking from scratch and there were some use cases that made me paranoid.
Hi,
I used similar method of https://vorixo.github.io/devtricks/data-stream/ (Chunked RPC) to send server's save slot to clients (about 150KB), but after sending is completed, replication doesn't work for about 5-10 seconds. Then, positions and other things suddenly replicated. It seems because there are many data queued (UNetConnection::QueuedBits) and the network is saturated (UNetDriver::ServerReplicateActors_MarkRelevantActors) until the queue is freed.
I couldn't find any better solution to send large array of data to clients, using custom socket make porting game harder and had its own headaches such as port forwarding and NAT. Is there any other solution or tricks?
can i change a repnotify struct "at once" so it doesnt trigger OnRep each time i change a member ?
its only a struct of 2 members so i might just set it using the struct constructor
You can, but you should handle this case anyway as there's no guarantee the update will arrive together on client (it's rare but possible for it to be split across two updates).
There's something I don't quite grasp 100% yet;
Slot based Inventory System;
I have a delegate function that when called, refresh the inventory UI on owning client. That event exists inside my Inventory Widget.
That delegate is declared in C++ on my InventoryActorComponent Which is added on my player's pawn.
Everything is working fine, when I call the function transfer slot to move an item to another place, I call my NetMulticast Function which broadcast my delegate, thus making the server and pawn aware that the player moved the place of an item in my inventory.
Now, something I realised this morning is that by calling my NetMulticast, I let everyone aware in the pawn's relevancy that the player moved something in his inventory, which is, bad. So I'm trying to change my NetMulticast function to a Server function, which works fine on the server. I then created a new function to run the same updateInventory broadcast on the owner client, and that is the part that doesn't work, the player never refreshes the inventory until I close and open it again. Anyone has a clue what I might be doing wrong?
Hello there, I hope it will not be interpreted as spamming as I asked also in #virtual-reality, but the question could be posted here too I guess
So, I was wondering: let say I have 10 peoples in a room and I want them to enjoy a VR experience together with a quest 2. Would it be possible for each people to run their own instance of the game, but also see the people around them so they dont bump into each other ?
It's a bit strange that you try to replace a NetMulticast with a ServerRPC
Cause NetMulticast goes from Server to all Clients that have an instance of the Actor.
And ServerRPC goes from owning Client to Server
That's very very different
Yeah and that's the behavior I want, because like you said, NetMulticast goes from Server to ALL clients.
All players doesn't need to know that one player moved an item in his inventory
yes
it wont so lets ignore i
Now, your Client is the one moving Items from A to B.
If you have a ListenServer, then in this scenario, it's still a Player, even if not a Client.
There are several iterations you usually go through to get this nice and smooth, so let's start with the working but not nice and smooth version.
Its dedicated server btw, but yes please continue, im with you thus far
Whenever your Player moves an Item from A to B, it sends a ServerRPC with what was moved where to the Server.
The Server then checks if the moving is allowed, and then performs the actual changes.
The changes possibly should trigger an OnRep (ReplicatedUsing) function.
For this let's assume the Inventory is a simple Array of Structs or so.
Changing it will trigger an OnRep_InventoryArray.
In that OnRep_InventoryArray you can call your Delegate. If you only want to notify the local Client you can change the replication settings of the InventoryArray to OnlyOwner, so that other Clients don#t even get the Data.
This should just work, but adds latency to the Inventory
Cause the local Client has to wait the full RTT to get the changes to update the UI.
At this point you iterate on your solution, allowing the Client to locally, in addition to the Server RPC, check if they can perform the changes and just predict performing them.
Now the problem comes when you move the Item from A to B and from B to C so fast that the move from A to B hasn't replicated back yet. This is where it becomes a bit yucky, because now we are deep in prediction land. And I wouldn't really go that far, what I would do for the Inventory is simply accept the changes on the Server as long as they can be performed. And if the Server ever notices something not working, that's when you send a RELIABLE RPC to the Client with the fully authoritive inventory array, and simply override the clients version.
For something more dynamic like movement this would be a bit crap, but for inventory it should be enough
The RELIABLE RPC iteration would not have the OnRep fwiw
But there are a lot of ways to make such an Inventory. You could also just not care about the delay.
Or you could make it Client Authoritive if you don't care about cheating that much and just accept whatever the Client says
But ultimately, you wouldn't need a ClientRPC and a ServerRPC in the same function
The UI action to move something triggers a ServerRPC, no matter what iteration you are in
And the Server then does its thing to move the item
After that you either have the OnRep. Or you predicted the change locally and don't need to tell the Client unless whatever they tried to do was wrong.
and with an onRep would replicate to the client and refresh the ui afterwards
Yeah assuming your Inventory Array wouldn't need to replicate to other clients
You can do the DOREPLIFETIME with condition and limit it to owner
And then the OnRep would only call for the owner
I would suggest you think about this a bit and maybe write down some setups and think about the pros and cons.
With multiplayer, everything is a pain :P
Okay yeah that makes a lot of sense, I think I understand about 90% of what you just said, but that is more than plenty to send me in the right direction. Thank you a thousand time, I truly appreciate you taking the time!
And I totally agree with that last statement, I spend more time in my thought in front of the PC thinking about how everything will work and where I can sacrifice to have it work as best as possible and ultimately, this feels like the best course of action for my needs.
Thanks again!
anyone managed to test multiple game instances with two gamepads? right now only my first gamepad gets routed to the listen server
Hi there, so apologies if a solution could've been found online, my google abilities have failed me. I have been having what I think is a relevancy problem but I must be missing something, would appreciate any info.
This is in blueprint -> Actor Replicates and all other replication settings are set to default (Awake, bAlwaysRelevant=False, etc)
OnHasAuthority=True call and toggle an OnRep bool
The OnRep function will then only ever be called on the server and fail to replicate down to the client.
I'm spawning in next to the actor and have had a go at jacking up all of my relevancy settings just incase, tried a scrub delay but there's no race condition anyway. Setting bAlwaysRelevant=True also works.
AFAIK OnRep should be a state saved on the server and when it becomes relevant to a client it will update them? So bit confused why it would fail despite being right next to the actor. (Have tried this on a test actor as well and had the same result.) Is there something I'm missing, do I need bAlwaysRelevant=True to be able to use repNotify's? That seems wrong
I don't have a solution for you, but no, AlwaysRelevant doesn't need to be true for onreps to work for clients (that are relevant) to receive onreps, the default actor settings should work just fine as long as you're within cull distance.
Okay cool thanks for the confirmation, I'll try in an alternate project and see what happens
https://dev.epicgames.com/documentation/en-us/unreal-engine/actor-relevancy-in-unreal-engine This one has all requirements for a client to be considered relevant (around the middle), but as I said, the default actor (once you set it to be replicated) should provide those default settings properly, so I'm not sure where it's going wrong in your case, sorry.
Every 0.x secs im calling a function that does stuff then modify a repnotify property.
the server calls DoStuffOnNotified right after, and the OnRep_ method of the modified property calls DoStuffOnNotified
DoStuffOnNotified broadcasts a delegate
the issue is, at random times, the delegates arent fired anymore on clients (like for 10s i can have no calls, then it will call with the latest value)
can it be because im stacking to much calls ?
To make a character look up and down and have others see it, does the control rotation have to be replicated? Or is it possible to do without replicating anything?
this is the repnotify property, the sample is 9.2s long.
is it big ?
is the mover 2.0 out yet? my instict tells me obviously this must be the old version
mover 2.0 is out in ur 5.4
interesting. im in 5.4
isnt it if you only build the source code, not the launcher version?
i thought i read something about that
Hello, i new a dedicated server with UE, i have duplicated the target file to target for server and when i want to copile it i have this error :
UATHelper: Packaging (Windows): Creating makefile for ThridPersonServer (no existing makefile)
it's in your screenshot
Performance wise, if i have something like a timer showing on UI, i should run it locally so there is no obvious delay, and from server call something on finish ?
so im an idiot i guess lol. i interpreted it as that was version 1.0 and not the newest of 2.0
lol

"mover 1.0" doesn't exist, it was only called "2.0" because long-term it's an effort to replace the CMC
Is push replication worth doing?
Hi,
I am having an issue with the server (listen server) not sending information to the clients. When a player ready ups, their widget is updated to show that player is ready and its updated on both the client and the host. But when the host goes to ready up, it only updates the host's widget and doesn't update on the client.The "server_testing" is set to Run On Server and the custom event under it is sent to Mutlicast. I have no idea what might be causing this and any help would be appreciated!
Controllers don't replicate.
They can only be referenced on the server and the owning client of that player controller..
The thing is, you don't need a reference to the player controller to do any of this. You are on the pawn. You can use the PlayerState.
Hi, I’m making a multiplayer VR game where each player has a special ball. I want the ball to have client authoritative transform / movement and I have not been able to get it working. The ball does not need to collide with other player’s balls. Cheating is not a concern for the game. Below is how the ball’s position can be changed:
player holds ball with a physics handle
actor component on the ball that sets the balls location and rotation while ball is in flight
physics simulation for when the ball collides with the the world
Given the above ways that the ball’s position can be changed by it’s owner, is it possible to just replicate the ball’s transform using the owning clients data? I want the ball’s position to be extremely smooth, as smooth as offline play for the owning player.
The ball is a blueprint inheriting from StaticMeshActor. On the class defaults I have set replicate movement true, net load on client true, replicates true, replicate physics to autonomous proxy to false.
When in a multiplayer session the ball transform only changes for the owning player.
Does anyone have any thoughts or suggestions?
Ah, that would make some sense. Thank you for the feedback, I'll look into the playerstate!
client needs to send an unreliable server RPC with balls transform on Tick
Hi Everyone. Any idea why my "Move To" Node works on server and standalone but not on a client? Video for reference (First Move To and then using Follow which works when holding down cursor)
That little spasm they do when i click it's just the Follow node responding, I might change that later but if i disconnect it, the character running on the server is still able to move with MoveTo but the client is not
With Follow node disconnected:
I'm not sure if it might be something related to my movement component? but if so why would "Follow" work?
I'm pretty new and this is the first multiplayer test i've done
This is what MoveTo looks like:
Vs. Follow:
Found the reason, this option was toggled off:
@thin stratus I love the multiplayer blog posts, read through it while trying to improve my system and everything works great I just didn't fully understand/get why use the FDelegateHandle.
So right before we create the session we call that: CreateSessionCompleteDelegateHandle = sessionInterface->AddOnCreateSessionCompleteDelegate_Handle(CreateSessionCompleteDelegate); and if I understand this is ensuring that in CreateSession() when it broadcasts, our CreateSessionCompleteDelegate we bound in the constructor fires. But then why do we unbind after instead of just binding it initially and leaving? I like how it feels cleaner because it's not necessary anymore but is that the only reason, just because we won't necessarily use it again until we create another session?
Edit: Immediately after sending I realized that we do get the SessionInterface at the start of the functions. I don't fully get the online system but I imagine this object can/does change so we have to add/clear just to ensure not touching the old one. Am I correct in this thinking?
I feel like this is a silly question, but I'd like to explore it: is there a way to use the GameInstance as a secure vehicle to transfer a player data payload (inventory, attributes, etc.) from Server A to Server B along with the player's connection?
I'm wondering if I can maybe send an encrypted package on the GameInstance, and decrypt it server-side after player connection? Would this be a viable option, or am I way off-base in my thinking?
My Linux admin & REST skills are super weak, so I'm looking at ways to keep logic in Unreal, if possible.
Anything on a client can be manipulated by a client. Anything sent by a client could be faked. Even if you were to send an encrypted package to the client that doesn't mean the client couldn't figure out your encryption scheme, unpackage it, manipulate it, send it back, or even re-send older (or other!) encrypted packages.
Thank you and a curse upon cheaters everywhere.
Is there a way to make an AActor with no owner to become relevant only to the people within its net cull distance squared? I've been trying to figure it out but cant seem to grasp that part
that's exactly what NetCullDistanceSquared does
Yeah but, What I don't get are, the replication options on the blueprint instance I need to check to make it understand that is what I want. any documentation on their behaviors? Unreal's comment leaves me with 100questions about what to check and in which circumstances
just set NetCullDistanceSquared, don't set always relevant
don't set only relevant to owner
Mmhh.. Maybe I'm not using the right approach for my case then. I currently have a storage which, when I get out of range, it disappears, but the content doesn't show when I interact with it.
But, If I check net load on client, the content shows when I interact with it, but the storage seems to always stay relevant even when I get out of range...
It's generally good to clear your delegate bindings when you don't need them anymore. Otherwise you might have two callbacks calling without realizing etc. It's purely for that.
Ah I've been using them a lot more recently and never seem to clear but I will go through everything with that in mind aha. Thanks!
Only other question/thing I noticed was that because in all the different functions (CreateSession for ease of reading) after calling CreateSession(), if failed we broadcast on our delegate failed, but it also broadcasts bWasSuccessful in the OnCreateSessionCompleted(FName, bool). This function I assume is called on both successful and failed creation, so would be double broadcasting correct?
Anyways love the site, really set me in right direction after I found the other night.
Would need to double check. Can do later
Don't worry about it, when I get home later I will just test it to see haha.
Iirc our Delegate is to notify other systems outside of our custom session Subsystem.
The CreateSession callback we bind on the UE Subsystem only lives inside ours.
And we also broadcast ours if we never get to call the UE one
Our custom one is the one that we bind to if we want to react to our create session call. The UE one is only relevant for the create session call internally
Yea I was just thinking that when it fails it would technically broadcast the OnCreateSessionEvent twice to ourselves because in CreateSession() and OnCreateSessionComplete() it broadcasts false and bWasSuccessful respectively. I imagine it wouldn't cause any problems, like if I was just set up to it to toggle button active it would just reactivate button twice aha
If we broadcast in CreateSession then usually because at that point nothing will call On Create Session Complete
OnCreateSessionComplete is called from within the UE Subsystem. If we haven't actually called the UE CreateSession call yet for example then the Complete one won't call either
I think it also doesn't call it if the CreateSession call returns false on the same frame. I will have a look once I'm at the office
I figured there may be some weird interaction somewhere. Oh well hasn't caused me any problems aha so I'm sure I just missing something 😛
Well, restarting the editor solved the issue.. strange, oh welp
Just checked. I'm only broadcasting the custom delegate in CreateSession if it fails directly when calling it, at which point I also clear the binding again. They shouldn't double call.
I completely blanked on the clearing the binding right before haha
CreateSession doesn't broadcast the inner delegate if it fails directly.
UE CreateSession that is
Yea I was only looking at our one
If it fails the same frame you are supposed to use the returned boolean
But I completely missed until you said that haha
Bumping this
There is a short and a longer version to this
In theory it's enough if the server tells the client the Timestamp when the Timer should end
At least for like round timers and such things
For that it might be required to have a better synced net clock ( there are pinned posts about this )
If you have more complex situations then having a timer on both sides is also fine. Depends a bit on the situation as usual
I wouldn't say this has too much to do with performance
Its prison type game where as time passes routines changes and stuff.
1 fake hour is about 10 real life minutes (~).
Well i think i ran into a bottleneck
I did a profile here
@lament flax You probably only want to show the timer locally and let the server trigger the main events that happen after x minutes
Ok ill try that ty
Thats what made the most sense for me aswell. Server authority events. With client timer 'prediction'. Or a local timer, as one would say
If there was something granting extra time, That would be an RPC or an OnRep variable with the additional time
Regarding your question of overloading the netdriver, i highly doubt thats what happened. The max queue is pretty decent in my estimation
okay thanks
is there a handy list somewhere of server hosting solutions for unreal with their pros/cons?
the only two sort of complete solutions appear to be AWS Gamelift and MS Playfab (which does not allow you to push Linux servers?)
PlayFab should allow Linux Servers
Ages ago they only allowed doing that via commandline
Web interface only supported windows
I sure hope after all those years they support that now. Otherwise I got a con for you :D
Biggest con for all of those is the cost
It's also possible to just use regular server hosting/virtual machine cloud services, from the same providers, or others.
Cons: Cost again 😅
Although, I have a feeling these servers for games "packages" can't be cheaper than a custom configuration.
Throwing in 2 cents. While that’s 100% true you should still consider a scaling solution to make it cheaper. You don’t wanna pay for a server at 4 am with 0 players on it 😂
Definitely. You can configure rest times for servers, and dynamically allocate resources depending on traffic too.
Indeed 😄
@thin stratus in your experience what has been the most straight forward solution to setup and maintain?
doing more research, anyone got experience with agones :P?
Hello, just in general. When i swing my Hatchet in my UE Project with 100/100 ping theres a noticable delay because its currently server authoriative. Is it better advised to only client predict the swing animation or also the hit? Is there any BP way to do client prediction for this? I just want the smoothest possible gameplay for the player, if he actually hit something or delayed aint a big problem.
Hello! How to correctly rotate my top-down character? Character always shoud facing to cursor position. So, on cursor movement input i got this handler:
FHitResult CursorHit;
if (!GetHitResultUnderCursorByChannel(UEngineTypes::ConvertToTraceType(ECC_Visibility), true, CursorHit)) return;
const FVector CharacterWorldLocation = Dwarf->GetActorLocation();
const FVector TargetPosition = FVector(CursorHit.Location.X, CursorHit.Location.Y, CharacterWorldLocation.Z);
const FRotator FinalRotator = FRotationMatrix::MakeFromX(TargetPosition - CharacterWorldLocation).Rotator();
What the best practice to smoothly rotate character for multiplayer in this case? If i rotate it by control rotation, my movement (WASD) inputs start to work incorrectly, couse AddMovementInput work with same axis. Should i change rotation in AutonomousOnly_proxy instantly, and replicate FinalRotator to simulated only?
anyone available for help on replication cube, i've sucess to make dedicated server, the first move works but the position of my cube isn't the same on both clients
You have function that moves the cube right?
So what you have to do:
Create new event: Server_MoveCube
now, you take NEW event and call it** Server_MoveCube** and put it where you had old MoveCube.
and then you dispatch that event, set to run on server and there you call old MoveCube function
Something like that
hey guys, trying to do basic replication and i cant find onbegin overlap (box), i understand i dont have the same box icon (what box is this?) , also i cant get the same output for ** set vector parmeter value**
What am i missing
first image and 3rd image is a tutorial
is my variables
i think in ue 5.4 there is new icon, tutorial one is older version, you should have events when you click on that box and scroll down in details panel
@normal viper this fixed my pb :
https://www.youtube.com/watch?v=H4frXTRwZqI
I think i have to think first what has to be 100% replicated what has to be calculated on client side to avoid overload my server
This shows you how to replicate an object simulating physics across all clients, and how to make a blueprint class out of one so you can call events on your replicated physics object.
ahh ok anooying u cant just type it, now for the last one vector parmeter value
i just found out you can actually right click the box and add event there lol
dunno what i do here to add it to target this varible, left is there, mine is right
awsome
its not that easy to overload server i think so you dont have to worry, for sure avoid using ticks etc.
@normal viper also, better to start making things in blueprint and then if performances issues i change the slow bp to c++?
Yeah, I mean you can prototype fast in the blueprint and some things you probably want to make in C++. I'm kind of begginer myself so unless I will have heavy problems with overload I'm not thinking yet about c++, maybe I will decide to exchange something at the end of development cycle but for now if you are beginner like me, it's really hard to focus on learning all at once, there is so much. Master one thing, then jump into another. The best combo is to know both of them but I cannot imagine learning both at the same time tbh.
and I guess if something is already in blueprint, there should be no problem into deleting blueprint and writing it in C++ and connecting with whole system
yeah, i think a good thing to do, to merge short & long term, is to make base class on c++ and extend it with BP, so the work will be easyer in case of rework
but if you know c++ then nothing is stopping you and it would be recommended to do these things for performance
yeah
It's matter time of feature vs performances
i mean I heard that it's overall much better and easier to program with c++, once you know it..
and blueprints later are often kind of limiting what you can do
like going to buy smth to supermarket, depend of the time you have, you can go walk there or take the car xd
but its not my problems yet when you are beginner 😄
hehe anyway, thanks you a lot for your time
Finding my client is having null returns when trying to access an item in the game. Was wondering how to rectify this, and figured it would be a few toggles in the items replication. I'll figure it out eventually through trial and error but a definitive explanation would do me a lot more good if anyone has one.
I am work on a multiplayer game so i have to set fpp animation for owner mesh i.e. fpp and tpp animations for the other players. Both of the meshes are hidden from each other. But I'm not able to figure out what condition should I place in my function
I have a struct which holds all the anims
I have the animation logic in a custom cmc
Been toying a lot with this yesterday with the same problem almost, here's what I understand so far from it;
Only Relevant to Owner is self explanatory I think, only the owner of the item receives the replicates call
Always Relevant, stay away from it, unless you have something that every1 needs to always be aware of, all the time
replicate movements.. replicates the movements.
Net Load on Client; Forces the client to load all the items with this upon launching the map. Regardless of their position again. Not the most efficient.
Net Use Owner Relevancy; Uses the owner replication relevancy to determine this object relevancy as well, useful when you have an independent actor tied to a player for instance, a pet would be a good example.
Replicate; If it replicates to server or not.
If you check replicates but none of the above or almost, you get the Net Cull Distance parameter that determines the ranges of the object relevancy. Meaning, if your player is within the object relevancy, it will start replicating to that (or those) player(s), otherwise, it won't and the GB will collect it if it was previously loaded. keep in mind in a third person project, by default, your player location is the camera, not the pawn
Can anyone help me with this!!!
Is there a best practice for getting the Player ID controller of a pawn? I keep attempting to do so but always end up with the playercontroller_base being set to 0, even if running on standalone.
Any guidance would be greatly appreciated! It has me completely stuck. Is this the right way to pull the local player ID?
I'm really confused in what you're asking or you're using the completely wrong terminology, but this is the correct way to obtain the player controller from a pawn
So if I run this, and there are 4 players. Each one will respectively get the right player id? Given that self is the pawn class?
What is a "player ID" in this context? I'm assuming you're aware of what a player controller is, right?
Player ID being the PlayerController reference to the individual player. I am trying to within the pawn allow an interact onto an actor, which references the correct player controller during the interact
This is completely muddled terminology
Clients only have their own player controller around.
Not sure if that's a part of your problem but could be
And what's the player controller's role in an interaction? You can call a server RPC on the pawn anyway since you're possessing it and therefore have net ownership
What are you actually trying to to do? When x happens, you want x to happen.
I am fairly new to unreal engine, although I am attempting to have the pawn character interact with an actor the have the same blueprint interface:
Said actor needs to then update the GameState with values pulled out of the GameMode for current players that are in the game, and current players that are ready (Updated by an interaction on the actor)
Seems like its working except for my ability to get the correct character controller. In the picture, the Interactor is a object reference to my playercontroller. LookAtActor is a reference to the object of the Actor
Apologies if this is confusing
And what is a BP_Player_Master
This is the player pawn
You have to multicast the change if you want both players to see the change.
So if you run a game, and you have 4 clients (players). I think for each of them they all game ''their own'' playercontroller which is 0. So yeah in the world there is 4 players controller, but the player controller 0 is always the one that is asigned to the client.
So it's not like you have to write different code for player 0, player 1, player 2, player 3. Everyone is player 0, for themselves. Not sure if i'm 100% right and if its helpfull.
I get a crash when calling "GetWorld()" in my game mode, works fine on solo play
void AMainGameMode::OpenNewLevel(FString LevelToOpen)
{
UE_LOG(LogTemp, Warning, TEXT("Open Level Called"));
GetWorld()->ServerTravel(LevelToOpen);
}```
I get this breakpoint error in AActor::GetWorld() function
``Exception thrown: read access violation. **this** was nullptr.``
```cpp
if (!HasAnyFlags(RF_ClassDefaultObject) && ensureMsgf(GetOuter(), TEXT("Actor: %s has a null OuterPrivate in AActor::GetWorld()"), *GetFullName())
&& !GetOuter()->HasAnyFlags(RF_BeginDestroyed) && !GetOuter()->IsUnreachable())```
Hey guys i have a game idea, 3 diff places (imagine chunks of map), these all can get siged down by enmes in certain times, when this is siged down, everyone will be teleported from that set area, back to menu screen , then the area that got deotyed needs to reload itself, is it possible
in short, yes, in long, yes it's possible
ooo coooool any video links
The gamemode only exists on the server, make sure you're not calling this on a client
Check that the gamemode pointer isn't null when calling a function on it
I think an underrated skill is learning how to ask questions. Ambiguous questions will often result in vague answers. Nobody here knows what "sieged down" means or what your requirements are.
What you might want to do is breakdown this idea into smaller, more actionable ideas; and research them independently or ask very specific questions.
Here's my attempt at that, based on your brief blerb:
- Figure out how to partition a level into these three places
- Figure out how to get a list of actors within each partition
- Figure out how to send a command and teleport these actors to a different location/level
- Figure out how to reset a partitioned section of level
I think having each "chunk of map" be its own level would greatly reduce complexity for all of these points and I refer you to this site to learn more about multiplayer travel: https://cedric-neukirchen.net/docs/multiplayer-compendium/traveling-in-multiplayer
Non-/Seamless Travel
I tried HasAuthority() and it just made a breakpoint and said it was nullptr, im calling it from a GameModeState, could that be it calling from a client?
yeah mb
GameState exists on clients yes
void AGarrysGameGameState::SetLevelToOpen(ULevelData* LevelData)
{
if (IsValid(LevelData))
{
UE_LOG(LogTemp, Warning, TEXT("Opening level %s"), *LevelToOpen);
LevelToOpen = LevelData->GetLevelName();
MainGameMode->OpenNewLevel(LevelToOpen);
GameInstance->SetCurrentLevel(LevelData);
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Level Invalid"));
}
}```
Good evening. This message is a request for help addressed to experienced developers working with Unreal Engine. I am currently working on a multiplayer soccer game (similar to Rocket League). I’ve developed the multiplayer aspect using the Steam plugin and some YouTube tutorials, but I’m facing challenges because I’m trying to do something different from what I see in those tutorials.
The issue I’m encountering is that I want to organize players who join the game into teams. One idea that came to mind is to create a variable within the Extra Settings that serves as a counter for each team. Another idea was to create an array of Player Controllers for each team. However, I’m unsure how to modify variables within the Extra Settings once the session has already been created.
I would appreciate hearing about your approach to solving this problem and, if possible, any blueprints, videos, audios, or links that could help not only with this specific issue but also with the broader scope of the project. 🎮🚀
thanks alot for this great help
The idea is bascially
3 diff realms (citys), on 1 map , with 3 prisons , all these said maps ( maps as in just 3 citys on 1 map) can be travelled to from all 3 diff realms
only when said Sige weapons is summoned by prisoners most of the said city can be sieged down or i can make it simple for now (only prison doors/ vault can be damaged and broken into,
Once the prisoners have completed this they will get kicked to menu , so i can reset that city)
This is running 2 clients in "Client" mode. I am breaking on Begin Play of a weapon that is being spawned. Why do 6 instances of the rifle exist? Shouldn't only 4 exist?
Is it because each client is also creating a instance of the other players rifle?
If it's a properly replicated object, there should only be 3. 1 on server, 1 on client0 and 1 on client1.
From what I see, there are 2 spawned rifles (BP_GASRifle0 and BP_GASRifle1 exist on the server), so it would be 6.
Ok yeah that seems to be correct then. Thanks for clarifying it.
anyone able to help with this i've still not solved it
is there a way to still use something like Anim Notifies to set values, since ABPs do not replicate, and if so how would one go about it?
I get an "no owning connection" error when I try.
Anything animation is all local-only. You can have an animation notify set something in another replicated actor, but that would only work if the server is actually running the animation itself.
explains why any iteration I've went with failed with exact same warning
You're probably getting that message because a client is also playing back that animation, and you're asking it to call an RPC on an actor it doesn't own.
ye
I assume hard-coding that info instead of using anim-notifies is the next work-around
a bit messy, but it'll get the job done
forgot to say, ty for confirming this 🙏
at least I can move on quicker now
@peak wadiTypically the pattern is such that some game state (movement, abilities, etc) drives animation, which can drive notifies that do things like play sounds and particles etc
if it's a notify for gameplay (hit detection etc), you can either run it clientside and have the server OK the results of that in some way, or have the server run it too, and use the servers notify to do the actual thing (hitting something)
working on the combo system for the character, and I was using the anim notify to basically give me a time-frame where additional input will be saved/queued for the following attack
so it does have to do with game logic that should absolutely be replicated across the board, and I should probably have been more informed on the matter before I went w/ it.
Good news is, the work-around is easy if a bit less convenient.
void AGarrysGameGameState::SetLevelToOpen(ULevelData* LevelData)
{
if (IsValid(LevelData))
{
Server_OpenLevel(LevelData); // Called by client
UE_LOG(LogTemp, Warning, TEXT("Opening level by client");
}
}
void AGarrysGameGameState::Server_OpenLevel_Implementation(ULevelData* LevelData) // Not running
{
if (HasAuthority())
{
UE_LOG(LogTemp, Warning, TEXT("Opening level %s"), *LevelToOpen);
}
}``` why does the Server function not run? it has UFUNCTION(Server, Reliable) and game state has replicates turned on
been stuck on this for hours, seems like game states just throws all my knowledge out the window
You can't send an RPC to the server on the gamestate.
RPCs can only be sent to the server on client owned actors, so like their player controller, playerstate or their controlled pawn, or a component attached to one of these actors, or any actor that have one of these as owners.
what would you suggest to use when using a ServerTravel function?
also does the server just not run game state code cuz i tried has authority without an rpc and it never ran it
You'd have to make sure the server is running it.
In some ways it doesn't really matter where you'd call the RPC, just so long as it is one of those actors. It's probably just easier to put it on the player controller as it's something that isn't specific to a controlled pawn (unless you wanted only certain pawns to be able to execute this command) and it isn't really something tied to the state of a Player.
wont player controller cause ServerTravel to be called multiple times since there are multiple instances
RPCs are called on the instance you call them on so no
Player Controller 1 on Client 5: Presses Input > Calls RPC to Server
Server: Receives RPC from Client5 on Player Controller 1 > Executes code on Player Controller 1
If you wanted the server to do something for every player controller....
Player Controller 1 on Client 5: Presses Input > Calls RPC to Server
Server: Receives RPC from Client5 on Player Controller 1 > Gets All Player Controllers > Loops through > Executes code on each PlayerController
my problem is, the players doesnt call the function, another actor does when parameters are met
Ok, and is that actor a replicated actor?
Or at the very least, one spawned on the server?
nope but i can enable it
dont think it'll change much tho might be wrong
It kind of won't... If it's an actor spawned on the server, then hopefully the server itself is managing its state. And if so, then the server should be able to execute what it needs to based on the values it knows.
And if it's running on the server, there is no need for an RPC call to the server.
Server RPCs are for communicating specifically from a client owned actor to the server.
Actors not owned by the client would get the "No owning connection" message if you're trying to call a Server RPC on them.
If the actor is spawned locally on the client then it has no connection to the server normally (you can get client spawned actors to link up with a server spawned actor that isn't marked as replicated, but there's a bit of work to do it).
Will AudioCapture component work fine for online voice chat? Because VOIP from advanced session is not working at all for me
when my AI attacks me and I am the client, the damage is not recognized, the event is passed first through the server and then through the multicast, is this wrong?
Damage should technically only be occuring on the server.
If you wanted a damage number to appear, then yea, that'd be a multicast during the point where you're applying the damage.
Are you using the built in ApplyDamage and AnyDamage events?
Yes
Apply PointDamage
And my character have Event Point Damage
So on the character being damaged do you have AnyDamage event setup?
yes
Do you have it setup to subtract the damage amount from a health amount?
thanks
i need that too
Show screenshot?
okay thats dealing damage and how about for the receiving end using AnyDamage
he doesn't receiver either if i use the anydamage
I think you might be using the same Event PointDamage twice instead of one on the actor that deals damage then AnyDamage event on the actor that receives damage
Yep
Then you use the damage float value to adjust health
okay I see you have Apply Point Damage but i havent seen any screenshots using the AnyDamage event.
AnyDamage deals with incoming damage so you can adjust health values or whatever
but i cant use the event pointdamage?
Event PointDamage is how you inflict damage
And i receive the damage with event pointdamage right?
:0
so AnyDamage deals with ... ANY damage
but if i use anydamage, i cannot acces the direction or hit info
well the other type of damage is radial damage, but you kinda get what you're given with BP. it's a bit more powerful in C++
but it's a little strange to be using the legacy damage system for new development
it was supposed to be removed from 5.0 but Epic got cold feet
but
the system works in standalone if i use pointdamage and event point damage
as client, is not working
because its authority only
Yes you can use Event Point Damage if you need to access the hit server side, but I find it easier just to use AnyDamage so theres only one event that can modify health. Just makes this easier in the long term.
There's no event connected
if i spawn 2 clients, the first objetive, doesnt receive damage, but the second client (not objetive) receive the damage if i put the client in the trace of the sword
why is that?
If you want multiple hits in one trace then use a multitrace
Can a listen server be achieved in ue5 (a host multiplayer system)?
Yes matter of fact it works out of the box
ok thx,
I've learnt about listen server and dedicated server, is there more types?
Well yes but those are the most common for games
could you name them? I'll look into them a bit
I mean you also have p2p which unreal doesn’t do. Unreal out of the box has dedicated and listen
do you guys use beacons with servers?
https://dev.epicgames.com/documentation/en-us/unreal-engine/using-online-beacons-in-unreal-engine?application_version=5.3
A little bit ages ago, what do you want to do with them?
I have no idea, I just found them and thought that they could be important for servers..
Then why mention it? The common use cases for them are stated in the article
so from what I've read, they are good for sessions?
"Common actions performed by beacon classes are to request quality-of-service information, reserve a slot in a game that the client wishes to join, receive a list of the names of players in a game, find out the score and running time of a game in progress, and so on. "
Well it depends if you're wanting to do something more advanced than an OSS would typically allow since a lot of querying use cases are already covered
But reserving slots for a party is a good one
if my game would be on steam, should I still use these beacons?
It depends
what is the thign that enabls server to have over cap vips
or admins
so on a 32 cap server a admin can still join
i guess so
ark has it
no matter what the cap of server was they would let u over cap it if had vips with like 2o ish slots
The "cap" on players is a soft cap.
You can set the cap to 100, and only let 20 people in freely.
The other 80 slots could be left open to a whitelist of players.
Its really up to you how you manage all that though.
There isnt really any built in mechanisms for this.
As its pretty game specific and difficult to generalize.
In the OnlineSubsystem I see StartSession() marks a Session as in progress (as opposed to being in Lobby or Pending) but what exactly does this do? Is it similar to GameMode's MatchState? I just realized I was thinking of the GameMode's MatchState when working, then realized I don't really know what this one does, as in my previous version I never called StartSession and it seems to work fine.
Is OnlineSubsystem better than beacons?
I'm havn't really looked at beacons, but aren't they mostly different things (like the point in them)?
I'm not sure but I've never heard about OnlineSubsystem, so I'll look into them
OnlineSubsytem is used to provide clear abstraction to common online functionality across different platforms (i.e. Steam, Xbox, Playstatoin). Then you can use to get access to Profiles, Friends, Achievements and bunch of other stuff from all the different services
eXi has nice page that goes over a bunch*: https://cedric-neukirchen.net/docs/intro
Here you can find all available tutorials in one place!
oh thx, noted
@twin juniper You should go through the pinned comments in this channel.
yea, I'm just gathering info
i shoudl too ^^
Everyone that hasnt, should.
Hello! I have a help request. I've read the pinned data, I'm a webdev with 10+ years of experience, and I've been working on single player games on UE. I'm trying to work on an extraction shooter (like Gray Zone Warfare).
I'm still on the planning stage and I wanted to ask how this is usually done when it comes to architecture. I know you can connect databases to UE5 but I'd rather leave all DB related logic to a specific dedicated backend that can scale, and have only game logic on the UE5 server. Is this common and expected, or is it uncommon and I should only use UE5?
I found absolutely 0 tutorials on UE replication + custom backend; it's usually one or the other. For MMOs people use the custom backend, but for games that have "matches" it's usually UE replication. Since I want things like inventory and player progression to be saved, I know I'll use a DB, but I wonder if I can have the player connect to the UE game server and have the UE game server connect to the custom backend?
UE Player >>> UE Server <<<<>>>> Custom backend
You can have the client connect to the backend for read-only purposes, but there would need to be some authentication involved as well, and you would never want a client have write access to the backend if you care about cheating (or the general health of your backend), as giving full access to write essentially means players will be able to write whatever they want to your database.
That's partly why the UE player should only talk to the UE server, because the custom backend saves things and the UE server does the data validation. I believe that UE player should only connect to UE server after authentication
So that's just it, you'd have the player connect to the backend first, authenticating them, then the backend would direct them to connect to whatever game server. From there the actual game server can read/write data as needed.
Isn't it the other way around? if the player connects to the custom backend, then the custom backend will need to validate data from the UE player; doesn't the UE server do the validation, if it's written correctly? i.e. if data is correctly replicated on the server, shouldn't that be enough to validate data to the user? because then the UE server would connect to the backend, and the backend would only send/receive data
(backend would only accept connections from UE servers)
How would you verify if a player is allowed to log in with a specific account? Are you going to have unreal game servers running that are just there to log players in?
Half custom backend, half UE server. Example: user has a widget that sends username/password. It would attempt to connect to the UE server, which would try to open a connection with said username/password; if it fails, then it returns a message back to the UE player and closes the connection. If it works, then the UE server keeps the connection to the UE player, and every data would come to the UE server, which is then replicated to the UE player
so if we have an inventory system, and the player tries to move one item from one place to another, it would replicate to the UE server, which would talk to the custom backend
So then the answer would be yes, you're wanting to have an unreal game server running to log players in.
yep
but I feel like it's just more than log in, no? if we're on a "match", then it needs to do all the logic of replication between the server and other players, but it would also need to save data from the user in the backend
What I'm suggesting is that you have a connection to your backend that is maintained on the client but is read-only for most data. That connection is then the stream of data that allows your backend to tell the client what to do and can feed it information before it is actually connected to an unreal game server. This connection can also ping the client from time to time to make sure they're still connected, receive messages (even across servers), or anything else that is a level "above" a game server.
Lets say a player logs in using your method, but doesn't queue to do anything, deciding to choose a character for hours or browsing around on whatever you're presenting them before they're actually playing the game, not idling, but not exactly going in to play.... They're essentially using up expensive server time just so that you can pretty much display them some UI.
If you used my method, you're having them connect to the backend directly (as read only only minimal details are allowed to be manipulated!) and authenticating them, and they can receive whatever data from the backend as needed, and make requests to it, you've authenticated them, so you can display them data relating to their own account. They can also request to join into the game and the backend can direct them to connect to an appropriate game server when necessary. This would typically be far less expensive as it doesn't involve running a server meant to be hosting a 3D video game with replication. An example of something like this could be Dead by Daylight - you're free to mess around with your account, you can see all the characters you unlocked, you can set up what certain rollouts are set up to be for whatever characters, but you're not utilizing an actual game server until you've actually done some matchmaking, found the 4 other players that will be joining you, and the backend launches the game server where they all connect and play together.
I see, I understand your viewpoint now; biggest problem is that after logging in, the player will have access to things like inventory and other gameplay systems - I don't believe the inventory will be so simple, but I guess it's better than using a 3D replication expensive system.... thank you for the response!
I wanted to avoid duplicating systems like inventory (because then the data will need to be validated if it comes from the client) on the backend, but now it does make sense why GZW pushes the player directly to an instance before they have access to the inventory
I'm guessing from your response that I should try to do as much work as possible on the custom backend since (1) I'll have more control over it and (2) it'll be less expensive for the UE server to run
Expensive 3d replication... that reminds me of the guy that wanted to replicate a scene render of his inventory to update the client. Shudder
in c++ server RPCs can only be marked as unreliable ?
or is it the WithValidation that is required
You have to specify either Reliable or Unreliable
WithValidation declares the _Validate() function which you can use to validate parameters and auto-kick clients or not. It's optional
Hello, I have a question about multiplayer game development. For example, there is an object in the middle of the game and I want to change the color of this object and replicate these changes. It seems that the recommended way here is to create the OnRep_Color method using ReplicatedUsing and assign a value to the Color variable. Then OnRep_Color will be called and replicated in all clients. I would prefer Multicast RPCs instead, but these calls will not run on people who join the game later. I don't like organizing my game code in a way that directly changes the values of its variables. This both makes unit testing difficult and makes it difficult to read. How do you approach such situations?
Hello, I have a question about
is the playerstate owned by the server or the client ?
it's spawned by the server in gamemode, but the player controller it relates to owns it (so you can use Server RPCs)
is this best approach to implement these states using On-Rep?
i'm donig it all the time and it works very fine, but i read an article which says on-rep is expensive for these states, should be using Multicast they says...
// Crouch/Prone :: [Player State related Area]
void ToggleCrouch();
void ToggleProne();
void ToggleSprinting();
UPROPERTY(ReplicatedUsing = OnRep_IsCrouching) bool bCrouching = 0;
UPROPERTY(ReplicatedUsing = OnRep_IsProning) bool bProning = 0;
UPROPERTY(ReplicatedUsing = OnRep_IsSprinting) bool bSprinting = 0;
UFUNCTION() void OnRep_IsCrouching();
UFUNCTION() void OnRep_IsProning();
UFUNCTION() void OnRep_IsSprinting();
UFUNCTION(Server, Reliable, WithValidation) void ServerToggleCrouch(bool Value);
UFUNCTION(Server, Reliable, WithValidation) void ServerToggleProne(bool Value);
UFUNCTION(Server, Reliable, WithValidation) void ServerToggleSprinting();
This is fine
The only thing you could consider is joining crouching and proning into a single enum
That has standing, crouching and proning
Cause they are mutual exclusive
Thank U very much for making it fine for me
finally i can continue working with it the correct way
Idk what you are exactly coding but you might want to consider putting this into the CMC or use Mover in 5.4.
Cause there you would only communicate the desire to crouch and the CMC would then figure out locally and on the server if you can crouch. And the OnRep would only be needed for the simulated proxies cause the local client would predict the change.
But I don't know the requirements for your setup there
I got the idea and it makes super sense in my system, i will do the same thing U recommend
for some reason, when setting a repnotfy var on server, the onrep is never fired (i have 2 instances of my PS, it should fire once on each client side of the PS)
//.h
UFUNCTION()
void OnRep_CurrentRoutineStateGT();
UPROPERTY(ReplicatedUsing=OnRep_CurrentRoutineStateGT)
FGameplayTag CurrentRoutineStateGT = TAG_RoutineStates_Uncompleted;
//.cpp
// in GetLifetimeReplicatedProps
DOREPLIFETIME_CONDITION_NOTIFY(UPlayerRoutineComponent, CurrentRoutineStateGT, COND_None, REPNOTIFY_Always);
void UPlayerRoutineComponent::OnRep_CurrentRoutineStateGT()
{
// breakpoint here never hit
}
any ideas ?
You 100% sure you are setting it on the Server?
yes
Does a breakpoint hit when setting it and is that the Server? :P
i can see it in debug string + its called in a _Implementation of type Server
let me screen you that
Hm, probably something "stupid". Don't see it immediately, sorry
np, ill find it someday
after some debug it looks like it gets call only if the value changed
so maybe something in DOREPLIFETIME_CONDITION_NOTIFY isnt right
i cant cast to my game mode in my game state, it returns nullptr but works fine in solo play
MainGameMode = Cast<AMainGameMode>(GetWorld()->GetAuthGameMode());```
called in game state if that helps
Is there a way how to debug anim blueprint variables in multiplayer?
In singleplayer I use slowmo command but that one doesn't work in multiplayer 😄
anim bp doesnt replicate
well variables that drives anim bp does replicate so I want to see if they are being passed correctly to anim bp
MainGameMode = GetWorld()->GetAuthGameMode<AMainGameMode>();
cleaner ;3
will check if that works
this still doesnt work
show your code
void AGarrysGameGameState::SetLevelToOpen(ULevelData* LevelData)
{
MainGameMode = GetWorld()->GetAuthGameMode<AMainGameMode>();
if (IsValid(LevelData) && IsValid(MainGameMode))
{
UE_LOG(LogTemp, Warning, TEXT("Opening level %s"), *LevelToOpen);
LevelToOpen = LevelData->GetLevelName();
MainGameMode->OpenNewLevel(LevelToOpen);
GameInstance->SetCurrentLevel(LevelData);
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Level or Game Mode Invalid"));
}
}```
you're probably calling this on a client
thought game state was ran on server
on both
how do I get it to be ran on server
cuz yesterday i was told server RPC doesnt work on game state
Hi guys , is it possible to keep same player controller presist on seamless travel ?
It doesn't work on gamestate because you need to be the owner of an actor to fire a run on server event on it
transmitting data from clients to server goes through actors the client owns
Their pawn, their playercontroller, their playerstate
yeah question is how do I call it on server
if it runs on server it should be callable on server
Anyone here tried the resimulation physics replication mode in the editor? My physics controllable objects get through geometry at times when i dont run it in single process (open the thread for a nice story with a conclusion)
I've researched how hit reg in games like valorant and CS work with rewinding time to the game state that the shot happened. Is there any good resources on how to actually implement that because I don't understand how they would properly store the character's poses and how to accurately get a synchronized clock in order to send timestamps from client to server.
depends on the accuracy that u need, i can recommend you to start with something based on bounding boxes or capsules for hit verification
here you have a resource: https://vorixo.github.io/devtricks/simple-rewinding/
no, but intuition works really well most of the times LOL
thanks so much this type of article is exactly what i'm looking for. is the basic idea of this tactic to send the bounding box the client thinks the opponent is and seeing if that matches the boundign box of the enemy on the server?
it depends on the problem, really
gotcha take a look and come with questions, always happy to answer
but no you dont send box data, in this model you only send a timestamp of when the shot happened
and you have an array on the server with where the bounding box of the actot was at a time
so since you send your timestamp... the server can know where that client was at that time
take a read and u will understand it better
so we're trusting the client that they hit the enemy as long as they hit the bounding box of where they should be?
yes, we only validate the shot if it falls within the box, yep
cool
I don't need to get any more specific about it than that for my game I think.
you might not even need this
u can do a simple distance check, depending how arcade-ish ur game is
im trying to make it pretty competitive so i am caring about stuff like this.
ah perfect then you can start with this 👍
and you can do another layer of validation for headshots with extra math (as heads will usually fall on the upper part of the box)
would that be second bounding box?
no... you can simply validate heads hits if the hit falls within the upper part of ur box
it isnt as accurate as CSGO or Valorant, but building a solution where u have animation determinism is very complicated
and timeconsuming
yeah this game's gunplay isn't as tight as something like csgo or valorant
mine is closer to something like overwatch
:) good luck with it and happy deving
thanks
Or how co-opish your game is 😅
tell that to fortnite XD
They're just try-harding
I need help with VOIPTalker.
https://blueprintue.com/blueprint/udr_w73k/
I tried adding the component as well, but no luck. Voicelevel prints 0
Stuff like AudioCapture works well.
Hey, I have a simple VR Basketball game and now the client is asking to add "multi-player" he basically wants to be able to sync local players score and to be able to have all the players play the game stating in the same time and use the same difficulty level. What would you suggest for that? I feel like the unreal multi-player system is an overkill for something this simple. BTW I don't have any experience with UE multi-player
I was thinking about make the game run an http server to receive some messages like score update, or start game. The client is already developing a standalone application to create the game session, so he would call my http server
Another option would be using something like socket.io idk
Id suggest he hire a multiplayer engineer.
Also kinda sounds like hes just asking for a Leaderboard?
Sounds like all hes asking for is that Score be pushed to a DataBase somewhere?
Waht do you mean by a 'http server'?
I've done a leaderboard once and it was just a data base on a backend platform, I still don't know how to create your own backend thing...
How can I replicate things like the relative rotation of components to clients in a 'Join in progress' state?
The clients eventually sync their rotation given the correct rep notifies eventually fire, but it would be good to start everything in the same rotation.
I'm using blueprint by the way, if that matters :)
repnotify is the answer, how delayed is it?
It's prety bad, let me take a screenshot real quick
i mean 0.1s, 1s, 100s?
Well in this case, I have a arrow component rotating inside my actor, and I want the rotations to match. At the moment I can't get it to sync to the server when the client joins, it just seems to act its usual client side manner, starting its rotation where its initially set
thats my bp (just trying stuff out atm)
and the rotation diff
ignoring the fact that that rotation is framerate dependent so you're rotating at different speeds on different machines
what does the repnotify do?
yeah I know that
its just for testing
I currently don't have it doing anything
If I set rotation in there, then it'll update rotation every frame, which leads to hitching etc with packet loss and latency
You aren't doing yourself any favors by havnig the mesh rotate completely independently on all machiens
my thinking is if I can sync that initial rotation, the client can handle the rest
How do you even know if it's in sync right now? The mesh rotation isn't synced. And you haven't shown what the repnotify does
Also what's the update frequency on this actor
Is arrow attached to static mesh?
Because when I look at it with my eyes and I see a 180 degree rotation difference at the speed its rotating, I know it's not in sync
show the component layout, what the repnotify is doing, and the actor replication settings
Rep notify is in this screenshot my friend
you aren't doing anything on rep
see ^
First off, remove the rotation of the mesh. Just rotate the 1 synced thing. Right now your mesh is rotating at different speeds AND starting at different times relative to the arrow. You wouldn't even know if the arrow was synced because the mesh rotation is so out of sync.
You don't need a repnotify here, just a replicated variable.
And you'll need to implement some smoothing if you want it to be butter smooth. A decent approach might be this.
Tick -> has authority? -> yes -> Thing.Yaw += Speed * DeltaSeconds -> set ReplicatedYaw
-> no -> Error = Thing.Yaw - ReplicatedYaw -> Thing.Yaw += Speed * DeltaSeconds + SomeSmallNegativeNumber * Error * DeltaSeconds
Is there no way to just get the rotation on join and let it run from there?
don't take my math at face value but something like that is the general form for smoothing
I mean sure, but you aren't guaranteed to be in sync, what if the first packet on join is late?
Do you care about the speed or the angle or both?
If it's just angle and isn't constantly rotating, the typical approach is to interpolate towards a replicated TargetValue
you'd do that for AimDirection for example
networking is hard as shit, the speed of light is a bitch
hm gotcha. I understand what you're getting at - is it standard to use lerping to replicated values?
Depends, that won't be great for something that's meant to continuously spin smoothly
also if it's really high frequency you might switch to using multicasts, depends on the use case really.
Assuming I'm doing the rotation using detla time, one thought I had was just checking the replicated value against the current and if its above a threshold, just kicking it back into place
There's a ton of approaches, it's all really dependent on what state of the thing you really care about. Look into the physics replication stuff, they do a lot of smoothing and interpolation and extrapolation
if you know it'll always go at some speed, the approach there will be very different from if you don't know what speed it'll be
It's all basically PID controllers though at the heart. Calculate some error, and do math on that error to feed into your update of the thing
I currently have turrets in my game that use a pseudo PID controller, instead of feeding clients the server turret rotations, I just tell the client the target
and when its locked on, I just send through the rotation to make sure the client hits its mark
its seamless enough, even in bad network conditions
Just telling the target should be enough for that situation. Are the turrets predicted or do they only fire after a round trip to the server?
round trip? if you mean this, it's all server authoritative, client side turrets are almost entirely cosmetic
I mean to fire a turret, what's the chain of events?
does a player fire them or do they have some rudimentary ai
is the projectile replicated or is it launched and flying locally on all machines
it's ai, it finds a valid target in range, (that is replicated to clients), everyone points to the target, when the server turret is within a cheese aiming threshold, it fires (rpc multicast)
hitscan for now, projectiles in the future
most of the time the server and client should agree on the turret direction at time of firing
but you can always include a direction vector in the fire multicast
yeah that's what I do. I just force the clients to match the server
I wouldn't mess with the turret rotation, just use that direction as the firing direction
the turret shouldn't be more than a few degrees off from that unless there's some big time problems
Check on your replication frequency though, there should not be much of a delay at all from server to clients beyond ping
yeah I actually noticed that in my testing.
That rotating arrow from before is a god target, and I noticed my turret was bugging out on the client side (that on fire rpc made it flick to the target for one frame then back to its client side target the next). 5 minutes later I realised it's because the rotation of the target isn't synced between client and server, causing that aiming discrepancy
and since it's all ping delayed they should all more or less see the same thing, just at different times
yeah LOL as long as the turret is aiming in generally the right area, players won't be able to tell (it's a coop tower defense, so I can cheese the accuracy)
yeah I'd just multicast the projectile initial conditions. I'm working on a projectile system right now that basically just relies on predictable flight and replicated initial conditions
for that simple rotating target, what would you recommend? I see a couple of options to go for, but I'm not sure what the best one would be here
Okay, I think I found a really good solution
both client and server assumes its rotating correctly
but the client uses a lerp to smoothly match up to where the server is. so it will probably be a little tiny bit behind, but visually it's very hard to tell looking side by side
How do you reduce the position correction for latency like in Fall Guys? i.e. make the CharacterMovement component not adjust the position as much when the ping is bad?
Fall guys probably has zero prediction
I mean they already move like shit, what's another 30 ms of lag
It works for that style of gameplay though, where most of the time is spent not interacting with the other players. Don't need the accuracy. It's like a pseudo-pvp style of networking. It sucks if it's meant to be competitive but Fall Guys isn't an esport game. Neither is my game. There's so much going on having the latency corrections is jarring.
I know the CMC has some thresholds you can play with NetworkMaxSmoothUpdateDistance\ NetworkNoSmoothUpdateDistance and others
can't wait to get quantum entanglement based networking
What is the uclass equivalent to NetSerialize for structs? I basicually just want to perform some compression on some data before/after its replicated
So there is no way to way get to the data before sending it?
only properties are sent so if you want to do custom serialization you have to wrap those properties into a struct
thats what I was afraid of haha, alright i'll have to keep dealing with what I have,
Appreciate it
hey this is probably not Multiplayerrelated but
but could be realted
im spawning an actor "FROM PLAYER CHARACTER"
but on the spawned actor
its failing ot cast to the owner ?
Instigator != Owner
I believe thr owner would be the controller
i was looking through lyra to find out why its movement is so much smoother than the default third person template cmc, but it doesn't really seem to do anything but replicate acceleration and overwrite the simulated movement, which the docs say cmc does out of the box, is this just not true?
Has anybody implemented Vivox for Unreal Engine?
I made my plugin to use Vivox Core but for some reason it stopped working recently.
Any chance this error my be the reason since I get all the logs for token and connection success, the portal shows the user did indeed connect to the server.
VivoxCore: INFO: RTP(0), [::init_connection] Not binding local port
What would be the best method to attach character mesh in a vehicle in a multiplayer scenario?
live scoreboard
of the players that are playing locally
no server side stuff is my responsibility, he does have a leaderboard, but now he wants the live scoreboard while you're playing you should see the name and the score of your friends playing in the local network
Probably by taking the control of positioning of the character away from the client entirely and let the vehicle on the server control it.
currently I got it the animation replicating and attaches but the positions are not correct where snapping to. I figured out disabling component tick of cmc fixed the jittering but the position isnt correct. It might be the root of the animation but position not same for server and client
Just attaching the meshes wont work, since both the vehicle and the character are still networked as separate objects. The network does not know about 'attachment'.
yeah I not sure how to handle attaching in a network environment. I have this issue with my tractor beam ability too
The rotation of 90 degrees is a different issue though it seems.
yeah i have no idea why rotation is different
character and scene component both y forward
If you are using a modified template character blueprint, then the mesh in it is usually turned 90 degrees, so might be it resets to that somehow after the animation.
When you open your character BP, does it have a 90 z rotation on the skeletal mesh component or the root or somthing?
does the animation finish when you have unpossessed the character?
its just a pose basically its just that position
but yes it keeps playing
I made it with control rig my first time doing any anims so maybe I did something wrong
Yeah, can't really help with that one. But what does jitter look like?
there's no jitter anymore after disabling cmc
That makes sense yeh
only problem I have now is the rotation and position of the character not being correct
and handling exiting vehicle of course
I already have it working perfectly just wanted to put the character in the car rather than making him hidden in game
I feel like I might need to make a skeletal mesh component in the car then set that seperately from the character and just set the actually pawn hidden or something
Not really sure what the best practices for this are. Have you logged the positioning on the client and server to see where the divergence happens?
but I think my animation the character is above the root and when attaching it attaches to root and thats why he's above the car at least on server side
I'm not sure how to log that tbh. I haven't done much with profiling etc.
do you mean with unreal insights?
No, I mean just printing it, but it does look like the root positioning might be the cause.
Changing root of animation helped alittle.. still rotation problem and server being in the air.. sigh
its weird how the client sees correct position while server doesn't. You'd think it would be other way around.
Does anyone recommend against using SQL dbs for storing player data and things?
I am playing the level as server. If I'm using TP character it seems fine but when I am using UFO character client UFO is not there
can anyone help
At least there is good consistency.
Nice ufo.. kinda like my game lol
Is ufo set to replicate all the basic stuff?
Nope
lol thx
Did you fix it?
nope bro can you tell pls
Open bp and check replicates and replicates movement that'd be start
I assume it's just a pawn class tho
wait let me check
Yes It's pawn class
I'll talk to you later
When you'll be free?
Alright I'll be free later.. I'm bout to head to bed. Did setting replicates check mark on class defaults do anything?
And make sure net load to client is checked too. I think it is by default tho
Hey buddy I need to go right now. Whenever you'll be free pls be on VC.
Vc?
Voice chat
I'll share screen
hey im watching a tutorial on how to use a click to move settup
And explain everything
I won't be able to do that til Friday
Technically. The controller is the NetOwner. You can still have an ownership chain where owners are not the controller though. EG a weapon owned by a character owned by a controller.
So I have a ball. A ball that gets hit by things. It replicates relatively smoothly in editor , but upon packaging and using a dedicated server it’s choppy/laggy
Idk if I’ll ever solve this one , is it just a matter of upgrading to a better server or is there some code I can add to make it smooth?
You want to use a movement-component to handle replicating its movement
unless you want to handle the replication yourself
probs a ProjectileMovementComponent would work?
Interesting thx
if a dedicated server is built from the same source state, but from a different engine, am I going to get "client/server version mismatches"?
Hi.
Does anyone know how to replicate the motion matching trajectory?
I tried this, and it partly works. If locally controlled, set the replicated variable, and in the anim bp, if locally controlled then use the trajectory directly from the trajectory component, but if not locally controlled, use the replicated trajectory.
Listen server to client works, client to client works as well, however, when it's the clients to the server it does not. Then there's some stuttering/lagging happening with the animations..
Anyone has any knowledge of this? Or can guide me in the right direction?
Any help is greatly appreciated.
Best,
Matias
I need replicated objects and dont want to use C++. Can i use actors instead of objects? After all, gamemode is also an actor, but it can be used without being spawned. I just wonder if it will be a problem in terms of optimization.
Navigation is disabled by default on clients.
@sinful treeok any way to enable it or ?
Yep, project settings
It depends on the number of replicated actors you'd need. Each actor that replicates needs to open up an actor channel which is used to send its networked data through and there is a limit of 2048 channels that can be open at once. The ways to get around this limit are within C++ land.
Client Navigation
Thousands in case. Thats sad to hear. But it must replicate to only owner client. Does it save me from this limit?
No. It's per actor, not per connection.
problem is it needs AI controller :/ ?
Well, then... I have an object which is created on server side and reference is none for all clients. Can a client read variable in this object in a user widget somehow?
That's why replicated objects can make it better - you can set them up to replicate through components or other actors fairly easily. So then if you were say, making an inventory that could have 100s of items as replicated objects, only a single channel would be needed for those 100 items - the channel would be the actor that is holding the inventory component that contains those objects.
and dont want to use C++
🙃 You gotta though.
Assuming you're using "Character", rather than using the MoveTo, set the location as a destination, get the direction from the character to the location, then use the direction and you can then use tick to add movement input to the character.
I really would like to but I sell asset in marketplace and cant mix C++ and blueprint ^^
Then make it a plugin
Selling a Multiplayer Project on the Marketplace that hacks around to bypass C++ is really shite
It's a really big asset with hundreds of functions and I don't know enough to convert it to c++ right now :/
Buddy, proper Multiplayer needs C++
Then make a Singleplayer Asset
Also I'm relatively sure you can add C++ to normal Projects too now-a-days
And Plugins can have content fwiw
@sinful tree hmm but is there no way to use the ai move to :/?
The single-player inventory systems are really not in demand 😄
But a Multiplayer Inventory system by someone who doesn't have the C++ knowledge to do it properly is? 🤔
A proper Multiplayer Inventory usually uses UObjects, paired with FastArrays
And that's C++ land
Pretty sure you'd want to sell high quality assets or? :P
I'm not sure if you can spawn an AIController and possess the pawn on the client. If you can, then I imagine it's possible.
Especially if it needs to be generic enough to work for whoever buys it
I'm not doing a massive multiplayer project, just an inventory system. Should I not sell anything if I don't know enough C++
- That's not what I said
- Inventory Systems are very complex, especially in Multiplayer
- The tools to make this, especially properly extensible for endusers, require C++
@sinful tree hmm
- You are free to ignore me and make a BP only one and sell it. Ultimately your call
There is no way i can use C++ right now, so it doesnt help my problem at all. But thanks for your advice :)
The point is that what you are trying to do would require C++. You can spawn thousands of Actors to have replicated data for your items, or whatever the idea is, but that's not the correct way and clocks up the ActorChannels and what not.
- You can't stop them from replicating to everyone... without C++.
The only other option you could choose is to use InstancedStructs, but those aren't as versatile as UObjects
I use Structs and the whole inventory system is replicated. I had a moment where the client needed to be aware of a variable in the object. I think I will follow a different way for this.
Apart from that, probably someone who wants to use the inventory in a really big game is aware of using blueprint for this is not right. I'm just aiming to help people with inventory with an example created with a blueprint
So I'm using lag simulation to confirm my slot inventory system is working properly. One thing I realized is that I want to prevent a player from sending over several server request for the same thing if he's lagging. A Simple solution would seem to use a local boolean, but I dunno, something feels odd about that, can't quite put my finger on it but feels like there must be a more elegant way?
Hi guys, little confused here. I have an animation setup as follows: when the player presses a key, I do a server check to see if an 'input allowed' bool is true, if not then I set it to true and multicast a transition to a sting attack animation in my anim BP. The sting animation has an anim notify on the final frame which first turns off the bool corresponding to its own attack animation and then sets 'input allowed' to true, via a server function in 'pawn owner'.
This all works ok unless the player spams the attack button. If I attack just as the attack animation ends, what I think happens is the 'input allowed' is set to true but the animation is not registered as being complete on the client pressing the button, so changing the animBP state does nothing, so the animnotify doesn't fire either, the result being the character just permanently freezes.
I can get round this by adding a 0.2 sec delay into my animnotfy, but I don't really want to a) because it disrupts game flow and b) it might not work in a very laggy/ high ping environment. I just want to understand what is going on, my understanding is that animnotifies will call locally on all clients that see the animation (I am using listen server model) and I am multicasting every state change.
Do you want a ping delay between pressing the key and something happening, or no?
The simplest way to get it in sync is something like this:
Press key -> tell server
Server then handles it from there, multicasting to play the montage if allowed to
but that'll have ping delay. Getting around ping delay is an entire topic of itself.
Might be wrong here but, I think you just discovered how players gets around using animation cancel in competitve games and why animation cancel is a thing to begin with. Reset the animation when the player starts attacking seems like the obvious solution here, but maybe I don't get the whole scenario
Is this multiplayer friendly? It has timers 😨
I am using this as opposed to a delay, which are a big no no apparently
was building servers for an update and got this pop up
Well time to rebuild the server binary then
did that
Good evening. This message is a request for help addressed to experienced developers working with Unreal Engine. I am currently working on a multiplayer soccer game (similar to Rocket League). I’ve developed the multiplayer aspect using the Steam plugin and some YouTube tutorials, but I’m facing challenges because I’m trying to do something different from what I see in those tutorials.
The issue I’m encountering is that I want to organize players who join the game into teams. One idea that came to mind is to create a variable within the Extra Settings that serves as a counter for each team. Another idea was to create an array of Player Controllers for each team. However, I’m unsure how to modify variables within the Extra Settings once the session has already been created.
I would appreciate hearing about your approach to solving this problem and, if possible, any blueprints, videos, audios, or links that could help not only with this specific issue but also with the broader scope of the project. 🎮🚀
You can use delays, but it depends on what you're using them for.
for the enemy to be blind for a little while, while it completes a 180 turn
what do you think, would it be acceptable to use a timer for this situation? I would like to ensure that I am doing it the proper way
Using a timer would give you a bit better control, like you can pause a timer or invalidate it. A delay you can't.
I'd also recommend using only "Set Timer By Event" as it avoids typos or issues when you may rename a function. You can connect a "Create Event" node to the red square delegate pin and then select a function you want it to call, so long as that function has no inputs, it should be in the list available.
Hey, I have the problem that when the listen server tabs out of the Unreal application, the server's performance deteriorates significantly, and clients even get disconnected. Is there any way to force the server to maintain its performance consistently?
I'm working on friends list stuff right now and is there a way to get access to steam in the editor without having to package and test every time?
Edit: I'm so dumb. I forgot I never activated the plugin, doing that lets me test without packaging haha.
You can run in "Standalone Game" mode I believe
Swear I tried that and didn't open but maybe I'm crazy will retry haha
Nah I'm not crazy aha doesn't open
I had this issue once, I didn't have steam launched if that helps
It only opens in packaged not regular standalone I've accepted haha
Package time not even bad rn so I will live lol
Should work just having steam open and playing in editor
Hmmm, well any idea what else could be stopping it?
Maybe a setting in ini file but idk should just work
I know that I had to tinker with the config file for the steam sessions plugin I believe, I had to add a few lines to get it working, not sure if thats the problem though
This is probably a dumb question but I don't fully undestand something with Session vs Lobby. I get that Lobbies are like session but the stuff like member list and member data is automatically kept in-sync for all clients who are in the lobby whereas session's dont auto sync player lists from host to client but what does this mean?
WHy one instead of the other?
is this in a packaged game, or when you are doing it via the editor?
This may not be accurate, but it's how I understand it...
A lobby is something you'd join before having all the players join into a session. This allows you to know some details about the players who will be joining you in the game before an actual game is launched. When all players are ready, the session launches and all those in the lobby would join the session. When the session ends, you could have it so the players that were in that lobby still remain in the same lobby and launch another session.
This then means that a session is useful for something already in progress, and if you're connected as a client to the session, then you would have access to the replicated data in the session anyway. A lobby then is useful for retrieving some minimal data from other potential players without having to join into a game server.
Anyone have any familiarity with playfab?
Sounds like asking to ask
Ah ok that kinda lines up to how I was starting to understand it. I started wondering if I was handling things wrong but I think I'm in the clear thanks aha.
This isn't what will fix your problem, but this coding is bad.
You're effectively causing something to fire every single frame for every character, and will continue to do so on characters that are not possessed by the local controller.
There is an event on pawns called "Receive Controller Changed" this gives you a reference to the controller possessing it. You can first check if it is a player controller, and then check if it is locally controlled. If locally controlled then you can add your mapping context. Doing this will remove the need for you to multicast on that event, and it will ensure the mapping is added appropriately without having to continually loop.
On to your actual problem, are these player characters just placed in the level?
Thank you! I noticed the same thing when i was trying to debug the possession issue just didnt get to correct it
the player pawns are spawned on a team selection when players join they select their team, their player character spawns on the platform. the game waits for all players to hit Ready then calls to possess each controller to their respective character
the issue only occurs client side as the server side will rotate correctly is they chose that location
I may just forget this logic and just spawn the character when the player joins and move them into position when they are ready, placing a "dummy" in place of the actualy character
basically skipping the possession
You may need to set the control rotation of their player controller as well.
isnt that what the "set control rotation" node is thats what im using to attempt that but i could be misusing that node
It needs to be set on the owning client
Should I set that before or after possessing?
I’ve tried calling the set control and possess in a Multi cast which didn’t seem to do much different
Not sure to be honest. In the default game mode it finds a playerstart and automatically spawns the default pawn in the appropriate rotation and I imagine adjusts the control rotation too.
You probably want to use the "Receive Controller Changed" to do it.
Curious as to how it would be done if the player entered a “vehicle” wouldn’t that use possess and have a similar logic to what in doing? Oh well I appreciate the help @sinful tree I will mess around a bit more tomorrow but will most likely trash this settup lol go an easier route
Hey guys can anyone figure this out?
Sorry was just reading through and missed something. Why exactly is this causing something to fire every frame for characters not possessed?
Edit: Sorry wait what exactly is the problem?
Is it just the character isn't showing in the outliner?
Because there is this setting that needs to be switched
yup. I've created separate blueprint class for UFO as pawn