#multiplayer
1 messages · Page 45 of 1
That is what I figured
And you are correct - it did not propagate the bool value
So I'm testing inside unreal with 'Play as a listen server" only have 2 players
One is the Listen server/ first client
the other window is the second client
I have narrowed it down to this bool value no being set
If I switch to the function setting the bool locally instead of trying to call the server func to set it and have it propagate downwards to clients- then it works fine
So I need to figure out why the bool value is not replicating to the clients when it is set on the server
In my UPROP declaration - if I specify using "ReplicatedUsing" then it acts as OnRep but with the added functionality of the listed funciton being called AFTER the value has already replicated correct?
ReplicatedUsing is OnRep
That's all there is to that
Or RepNotify or whatever you wanna call it
✅
Replicated would just be a Replicated variable
ReplicatedUsing is Replicated + OnRep function
Okay so Even if a client sets the bool value - would it replicate to the other clients - OR does the value HAVE TO be set on the server?
and it ONLY replicates downward
Always Server -> Clients
✅
You gotta re-read the Compendium if you ask this :D
Thanks for the clarification @thin stratus, I was under the impression is was required to call OnRep to "signal the value changed"
Oh I did
Nice try though
I have read that entire thing
And watched a crap ton of videos
So here I am now
If you want the Variable to replicate to Everyone, then it has to be set on the Server
Which is what I'm doing
And the Actor it is on has to be replicated
UFUNCTION(BlueprintCallable, Server, Reliable, Category = "Character|Call") void Set_OverlayEnabled_Server(bool InIsOverlayEnabled);
This is the function where I set the bool
{
OverlayEnabled = InIsOverlayEnabled;
}```
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category="OverlayVariables", ReplicatedUsing="OnRep_OverlayEnabled", meta=(MultiLine="true")) bool OverlayEnabled = false;
Overlay comp is a comp on the character
Is the Component marked as Replicated?
It's because I'm copying from BP plugin and I used UEs Preview bp in c++
To quick copy
I'll remove it but I doubt it's related
So I have the character set like so
bReplicates = true;
Do I need to flag the comp this way too
I'm asking about the Component
Yeah, it's its own Class
It also has to be marked as replicated
damnit I striaght up searched for an asnwer to that and didn't find anything
Okay so In the constructor I need to set the comp to replicate too
let me check real quick
For components you use
SetIsReplicatedByDefault(true);
setting it now
Score - OnRep is being called
Thanks all!
Tis a christmas miracle
what can make problem with joinin server which is on my desktop? these are my router settings I dont see anything wrong, when I create server on my laptop instead computer I can join server from computer but i cant join server from notebook which is on computer
any tips?
If they're on the same network (i.e. not going over the internet) you won't need to forward ports on your router.
It's probably a firewall issue on your desktop.
on same router
but I am joinin session created on server, yea I thought same I tried deactivate firewall on desktop
but same result
there is only basic windows 11 firewall
hmm sudennly its not workin also on laptop LOL
I suggest removing your port forward.
ok I changed wifi 5 G to normal wifi on ntb and I joined
hi im facing problem with replicates an actor.
I have an actor cube with simulate physics options set to true.
when i grab the cube on client, the cube grabbed in client's hand character, but on server the cube still in the original place.
i already set replicates and replicates movement to true on the actor cube.
how to solve this problem?
By grabbing the cube you mean attaching it to the player mesh?
yes
You attaching the cube only on the server?
im attaching it on client (not using rpc run on server)
but i also want the cube actor replicates the transform all across clients and server so any client that interact with the cube physically the other client can also see.
for example if a client push the cube by the client's character collision, the server can also see the cube got pushed by the client
Before attaching it disable the physics simulation, and attach it on the server, if the actor is set to replicate, I guess the attaching will replicate to clients as well
Anybody know how to fix this problem? (the variable is a structure)
Guys I have one question I am in multiplayer joined on my Dedicated Server with my 2 pawns both are planes (i turned off gravity to make it easier) however I see each other joined to map I dont see their movement any tips? this is how I am changing my direction
Remove the pin from the first event on both and add in custom event "SR_Move right" and so on then plug the functionality into the custom event. From the move right call the server event (Make sure the actor or pawn your using is set to replicates)
but doesnt it caused delay on the client?
Yes, but there is always a delay in multiplayer games
but if the cube is replicated. will the cube movement jitter on the client?
because the cube position is synced between server and client
the cube position on client will always follow the position cube on the server. will it cause rollback move on the cube?
When you attach it to something then it will follow the new root
It should not happen after you attach it to something (from the server)
this is wrong approach? just tested it and its not woring
working
bcs I used to use RPC
but pawn should have replicated movement
maybe I did something wrong
@real ridge I can already tell you, before you put too much time into this, that a Pawn will not work nicely in terms of Multiplayer. There is no Movement principals applied.
Only Character's support this. Even if you get the Movement replicated it will look choppy and at best you will be able to do fully Client Auth Movement, at which point a DedicatedServer seems redundant.
Ouh but there have to be some games similar to us I mean with planes etc which are working fine also with dedicated server or?
there have to be some way
I dont know if the way is use Character for plane 😄
and apply physiscs there
Dedicated Server sure, but Pawns don't have any built in Movement for Multiplayer
They only directly replicate their Transform
There is no Prediction, no Reconciliation, nothing
The only class in UE, by default, at the moment, that supports Client Controlled Movement over Network with proper features is ACharacter
There is a Movement Component on the Marketplace that apparently allows for more custom behavior
But that is paid of course
Yes I understand, but I can do it somehow in own way?
to make it smooth
or predict and rpc movement
The Character Movement Component is doing that for the Character
You'd need to code your own, in C++, which can take a long while and requires the knowledge for it
Multiplayer is NOT a Blueprint Only thing
Ahhh Epic why is this not done for characters.... :DDD how are people developing multiplayer games where you need to fly haha
I know every class I have I have c++ and then I have created blueprint part of it
In C++
Yeah just saying
You can open the CharacterMoveComp
And see how big that class is
To get an understanding of how complicated this is
character is fine but I dont know if I can use character for our plane 🙂
propably not
it will be curse
The rest is actually nothing character/humanoid specific
But again
If it's really important
You might want to look at the Marketplace
And purchse that custom movement Component
Cause that is supposed to handle multiplayer and custom shapes
lol character .h has 3k + LOC
Yeah that's just the Character hehe
It's pricey
But only if you can't afford it
I dont know if it is good to use any plugins for it ahhh this is very bad situation.... how the f* are planes games made in unreal then....
Like, it's not expensive in comparison for what you get
Hiring someone (or doing it yourself) will cost you several hours (weeks) or multiple thousands, cause it requires a higher skill level
So 350 is actually cheap as hell if one really needs this
But I would suggest you try to use a Character first
Pawn will not give you the wished for results
As soon as you introduce lag it will be shit
The only thing you could do
offf 400 is too much for me
lol its my monthly salary kekw
I need to hire someone to try it for me
I mean
like character
It will be okay for the Local Client
But the Simulated one, will look like shit
On higher pings
Cause you are lacking smoothing for the Simulated Clients
Which the CMC (CharacterMoveComp) also does
Kinda yeah
Game Dev is hard, especially Multiplayer ):
Not trying to talk it bad for you
But I know you will be back with problems really quickly with a Pawn
And waste a lot of time
Yo
Laura knows me well she is mad at me often because I am asking dumb questions
as c++ newbie

Ah i Dont know what to do now fack
I also found this video where man is doing dedicated server with pawns and movement seems fine https://www.youtube.com/watch?v=pz0VasHPS5g&t=152s but I believe your words so
In episode 15 of the UE5 game development series, we'll start adding multiplayer support. We'll first look at how network players spawn and customize our PlayerStart assignments. We'll then learn how client and server movement replication works, and add a client to server RPC (Remote Procedure Call) so our movement is replicated.
Previous Video...
need to find out something
Tutorials can be really misleading
So UE5 doesn't have multiplayer support and they add it?
If all they do is show it on local multiplayer with 0 ping
Well I guess, I'm just going to 
I now I appreciate all of your effort
now I dont know if I will buy plugin which costs same as my monthly salary
and then I will die of no food
or try to make it by myself
or use character

I can't see what did you type sorry
So MP is rich people exclusive now?
Yes
Always has been.
Na, but if you really have no budget, you should take the smallest scoped project you can manage
I've been a millionaire all this time without knowing it
So how's your Multiplayer Project going?
Banter aside, yes servers need money
I will choose this but not sure if character can work fine as "plane" kekw
But I was referring to the learning process
NOTHING IS IMPOSSIBLE
Yeah I mean of course you can make a Multiplayer game with a non existing budget, especially as a hobby.
But then keep the damn scope small and fitting to UE
Just do co-op. Then you can do silly stuff in networking because you don't care about the hard stuff 😈
Dedicated Server costs aside (you should really not do Dedi Servers if you don't need to), it's also tricky to do a Multiplayer Project that goes beyond the stuff that UE offers if you don't have the know how to add that.
now I Have feeling unity is better for multiplayer than UE epic does not care about people who want make multiplayer star wars or world of warplanes? they just care about first person shooters with character 😦
poor devs
Epic only cares about Fortnite
AND WHAT ABOUT SHIPS! ?
can transform from an actor be repllicated? for example game like rocket league where the ball actor transform are replicated across all clients and server?
how to achieve that
If you don't want to go into too deep of a rabbit hole with Rocket League, try the Projectile Movement Component first
There is a handful of things you can setup with that to make the ball relatively smoother
Just ignore the Projectile part of the name
i try using rpc run on server and called on event tick but i think that is not the most efficient way
Yeah it's not
i don't know I have never played Fortnite
it's for kids
Fortnite actually isn't that bad....in no build mode 😈
what about projectile for plane?

problem with capsule on character is
u change scale of it
or move
i mean u Can a bit
not a lot
u have limitations there with it
I will take one for the team.
- Add the following Components to your Actor:
1.1. A SphereComponent (Collision) as Root Component
1.2. A Static or SkeletalMeshComponent as Child of that
1.3. A Projectile Movement Component - Set the Actor to Replicated and Replicate Movement
- If you can use C++, do it there and override
PostNetReceiveVelocity.
3.1. In here set the Projectile Movement Component's Velocity to the received one. - In PostInitComponents, (or BeginPlay in BPs fwiw) set the "InterpolatedComponent" of the Projectile Movement Component to the Actor's visible Mesh.
4.1. Make sure any other visual Component (e.g. VFX) are attach to the Mesh from now on so they are also smoothed.
That's what I usually do and it creates quite the smooth moving actor
Of course not predicted but that's a different story
You're officially part of WizArmy™️ now
Because when I tried for example adjust capsule for plane I could only make it bigger to the height not on the width
there was problem
but I am propably talking to much already
ugh
Finally something on the Emily scale
Not sure how additional collision would work though
The Character Movement Component
Ah
WizardCell just needs to review it already 😭
I can affirm this statement is true because it's made by a beautiful name
Shit, now the 5 macro keys of my old keyboard would have come in handy
"Oh - I'm injured. I can't do it." - excuses excuses. So hard to find good help these days.
I gave it to my employee
She had the same one at home and you can#t purchase it anymore
I am now thinking why I am struggling to use pawn instead character when pawn is child of character ?
it's same thing I just have to deal with one sphere
It's your job now 
Stop mixing this up :D
i know u are master and everything I don't want to make you angry your compendium is my bible
I have a Keychron K4 now. Smaller and the added bonus of not having my cats destroy it by biting the nonexisting cable
But no macro keys
So I gotta type Character Movement Component
And Ability System Component
And Gameplay Ability System
why u mention this name on Christmas
Only when you become purple
911
Also, see what is happening here
The same as in #cpp
Laura is causing offtopic
Someone ban her already
then is time for me to talk bout multiplayer again and make your heads big
She's WitchCell now, she is allowed to do it
ANYWAY, have a nice Christmas Eve or whatever, I'm back to gaming
Happy Christmas I will take a nap and then try make plane from my thirdperson character and then spam you here with my problems
F*CK PAWNS 🙂
Warm Christmas, I'm back to hot-reload the house 
Jokes aside - I think it would be really nice if there was a CMC style thing, but not as many features. Like something for just simple movements with interpolation and correction. Built-in mind you.
pssst
yeah, tbh
Eren actually made something like this. But he discontinued it.
you can implement INetworkPrediction interfance
Not the prediction plugin
Something our byte brains can understand you mean
but oh my GOD it's so fucking hard
The simple movement comp that I'm talkin' about
When u are newbie and read all things about Unreal engine and epic ads u think WOW THEY HAVE EVERYTHING ITS PERFECT and then u start realising what all things are missing 
like, if pawn movement component came with inetworkprediction already built in
hello man u trying to use pawn too?
🤣
i didn't said I dont have experience with unity but maybe it has better support who knows

Unity is the opposite of UE. It has nothing and you need to buy everything from their Marketplace
Unity definitely does not have better multiplayer support than Unreal.
yeah, right now CMC is so coupled with Character that you can't separate the two, if you want to use IPredictionInterface with pawns, it's better to do a SIMILAR but more basic setup
i heard they have better docs
ah why I am destroying my Christmas this way
i would have NO fucking clue

u are copying it to your pawn? just .h has fucking 3k LOC
this wouldn't do anyone
yeah, it's ROUGH, it's so hard
https://www.youtube.com/watch?v=Bdjj91YzC-4 - @peak sentinel what in tarnations. My ears! MY EARS! (Though catchy song)
I actually did that
that's what i'm doing RIGHT NOW
day 344?
It was
yeah, right now i have uh
autonomous to server and back down
i'm jsut having huge troubles making simulated proxies look okay
oh god it's so bad, today i'm trying uh
no one else needs to see this
The CMC is also async now
simulation and using FRepMovement replication as the mediator
or going to be
how many hours are u working on it
Which it wasn't back when I had to deal with it
Is that song on Spotify though? @peak sentinel
so far it's been about like, 4 days of working on it? i'm taking it as simple as i can, ONE move send at a time, basic move acknowledgement, etc.
why u need it what type of game u trying to make ?
its a nightcore mix of "Catch Fire" song - usually nightcores dont exist in spotify (https://youtu.be/nl0qCdE5cuo)
Wack
going to be 😄
CMC and Character is overdesigned for the basic pawn type i need, if I used character i would be spending cycles calculating movement mode, acceleration that i don't need, etc., i'm making a basic tank control pawn that's moved via root motions (basically old school resident evil)
so, i went back to pawn, have a custom pawn movement comp, then i'm implementing inetworkproduction similar to CMC, but with a LOT of it gutted out
once i get everything in place, i'm planning on thinning out a little bit more (i need to focus on putting base movement BACK in because eventually i need that for the design i'm going for), then i'll probably do a write up on my experiences?
ah I thought u trying make plane or rocket like ne
me
or helicopter
it depends on what you might need it for, character DOES have flying mode? you could mess with the movement stuff and set the default movement mode to flying
but i don't know if acceleration and velocity tracking works well in flying mode
yes I just need to fly with it and I don't need ironman but regular plane hah

and the thing is I wanted to make own physics for it in c++
and this can be problem
idk what to do
mhmm, remember to think about things in the abstract as much as possible? again, if you side step the "walking" and "falling" modes and just stick to flying, if it has adequate acceleration and velocity that makes it feel like a plane, it doesn't matter that it isn't a humanoid you know?
mhmm
that's true
noone know it was person
if u change skeleton

but i don't know how to STAY in flying tho, i know CMC can change the default movement mode, it's just a matter of staying in it and making sure it doesn't switch movement modes when you don't want it to
maybe
i Can just deactivate gravity somehow
i willl take a look on it tommorow
ahhh everywhere problems
DEV LIFE SUCKS
mhmm, i would first start of seeing if you can create a character actor that has the default movement mode as "Flying," and then after that make sure it stays in flying mode
i think it can be possible but I don't have life energy to go try it now
i Cant imagine hours spend on big multiplayer games when companies are developing mostly own things
incredible 😄
for example war thunder
so complex
for example war thunder
so complex
war thunder is both very complex and very good game that runs well on slow computers
Hi guys.
there's games like (club penguin) using system on server side
wich give everyplayer his own room called house. with maximum of users 20
my question is how can servers handle these rooms?
millions of users = million of rooms even offline users have their own room that you can visit. if i want to make this how can i manage all of the rooms for online - offline players?
yes club penguin uses smartfoxserver it is perfect for this work but unreal server it self can't so this by its own
unreal uses sessions for multiple rooms means i need multiple ports (very limited)
thats what i'm searching for but didnt find solution for weeks and also i'm asking alot in playfab but no one answer me so i come here to search for the soluton
Happy holidays 🎈
Happy holidays! will be back at the new year
What's the schedule for xmas comrade?
Yes
You too 😄
yeah, this is the huge thing. the way that UE is built, there is only ONE world, and in order to have multiple instances you ahve to spin up more processes, but then i'm always concerned "does that approach bloat memory? for example, is it loading the collision of my meshes per instance and i just have that memory bloat or can my instances uses the same memory for it?" it makes it really hard, but then again that's why MMO people are paid to be MMO people and STAY in the MMO pool i guess 
In general the reasons why people use multiple worlds is to indeed prevent that issue where one instance has to load a bunch of stuff, so yes there's overhead per instance. Although I don't know exactly how much that is with default Unreal (also of course depends on how much your game loads in / processes).
Although this solution isn't necessarily just important for MMO games. Imagine you have a game with 1 vs 1 game mode, then you ideally don't spin up an entire instance for 2 players all the time 😛
Oh dang - GMC handles replicating montages/root motion as well. @fathom aspen. Review please 🥲
Did not just skip over your message.. Happy holidays to you as well 😄
Poor Wizard, always backlogging tasks on his back
I knew that, but now I got hyped up, so trying it tonight 😍
See what you did Duro? Now the kid won't sleep
He's the one who paid the high price tag and decided to not use it for like a month or something like that 😅
We need him performing well on CI-Games!! 😄
CI-Games?
Thanks for saying that for me 

Yes, vori brought me over. Kudos to him, we're now comrades 
Noice!
Am I now allowed not to try GMC tho?
🤣
The people must know!
With "the people" you mean.. You? 🤣
and @whole grove
ah right, she loves pings, innit? @whole grove
Lol
oh man don't even get me start on cmc with root motion, it's so dense
i still don't know what a root motion source is really
like, root motion extracted from animation... that's not a rootmotionsource right?
root motion from animation gets extract to... the rootmotionparams structures
but then what the hell is a rootmotionsource?!
What Is Root Motion?
Put simply, Root Motion is the motion of a character that is based off animation from the root bone of the skeleton. Most in-game animations are handled via cycles in which the character's root remains stationary. This cannot always be the case, however, as we can see in the example above. To handle this, we need to take the motion of the root away from the character and apply it to the character's capsule instead. That is the essence of what Root Motion does in UE4.
Is this ChatGPT?
No 🤣
like yeah, so that style of rootmotion you use "ConsumeRootMotion()" on the skelemesh comp
It's called the Unreal docs 😛
and that gets extracted to a rootmotionparams object
but what's a rootmotionsourcegroup?
where does THAT come from?
Ah it's more reliable than the former then ✅
i dunno right now i don't NEED to know, and i'm not being PAID to know, so i'm just turning a blind eye
LMAO
Hey all, I asked about this last night but I was very tired. So lets say I have a health stat and the player takes damage from another player. Have I got this right for order of operations:
Damaging player shoots other player, tells them they took 20 damage.
The player that took damage reports the amount to the server and the server then passes it down to all clients.
Is that right? Would that not be ripe for exploitation?
So we're #plugin-dev now?
I'm actually sort of shocked, it seemed that with UE5's new open world stuff including the chunks they could be easily used for MMO type stuff. Like, no one on chunk X - don't load it up.
Maybe they're working towards it.
If cheats matter to you then no, if a client can tell the server that they got damaged or shot someone and specify the amount of damage you are in the cheats zone. A client should tell the server it shot (ideally), or tell the server it shot someone (easier, more cheat prone) and then the server decides how much damage they should take based on what weapon used, upgrades etc. And from there the server can send it to others.
Ah that makes more sense to me
Thanks!
The golden rule with clients is that you can never trust them if you care about cheats 😄
Yeah, that's why I thought the way I was thinking seemed unsecure lol. I keep forgetting that as long as the server has information on health, damage, etc all the clients have to do is tell them something happened.
Would you normally put those sorts of functions on the gamestate blueprint?
Or does it matter
Depends honestly, sometimes gamestate, other times the player state or player controller, character/pawn etc. They have different purposes 🙂
Although sometimes it doesn’t matter too much.
There's an already TakeDamage in AActor (And ApplyDamage in GameplayStatics)
But we have #gameplay-ability-system now
but stupid floats
Yeah I looked into the gameplay ability system, but I'm not -quite- ready to dive into C++. I figure I'll get some rudimentary stuff running in blueprints and then I can always convert later.
Yes, someone help me recall what it's called
Searching the marketplace for GAS Blueprint and it brings up gas station assets
Oooo
Ever since I've seen Cedric yell a million times over GAS I'm not sure I want to learn it lol.
$34, but that's tempting. the GAS system looks fantastic, tbh - here I am storing attributes in arrays and structs like a shmuck
You can use my creator code at the time of purchasing
that's why i've made my own version specific for damage and health 😎 (i have severe depression)
Lol
Haha, I was going that route, Iskander. Or rather was planning to.
I've been working in a proprietary engine for 20 years and there's a lot UE does way better (No surprise, it's designed for licensing and third party use), but having an actual attribute system instead of trying to hack something together was always missed.
Since I brought her over?

It's the light-weight version of pensive
I mean, I'm jumping into the fire for learning multiplayer. I commited to re-make a game that was released in 1998 in UE partly because I want to see how quickly it can be made nowadays (spoiler: MUCH faster) and partly from nostalgia lol. However, it's an MMO and I hold no delusions of actually MAKING an MMO. I'll just be content if I can hop on a local server with a friend and we can do some stuff.
My overall goal is to learn more about networking and so far it's succeeding
lol
So it's an MMO and it's BP-only, I like it
MMO minus the first M
It will never see the light of day, but I'll get some joy out of building it.
Can someone please explain to my idiotic self how to fix my damn health bar and widgets to actually work and not send errors. This has actually started to piss me off cause NOBODY will explain it simply step by step
Haha, well I had looked into OWS but sadly the biggest hurdle is no seamless zone loading.
this is for multiplayer
You're not an idiot, friend - you're just learning.
i play, i attack the other player, i get the last error in the line of errors and the bar doesnt update. The other widgets show up but give errors every time i exit the editor
no matter what ive done i cant fix it
if you want i can get in a call and show you my code, or something, but i've been getting this error for the past 2 hours
how? I dont know what the hell im really doing. I follow tutorials and learn from that. The health bar is a bit far
If you're following tuts then itsyourproblem.jpg
i know. But i followed the tutorial exactly and it just wont work
The tutorial could be out of date?
I've run into a few that don't work anymore due to changes from 4.x to 5.x
there was one series that was detailed and everything, but it cost 60 BUCKS for something im gonna use once
im thinking that might be it
the thing is its the only multiplayer one i can find for a health bar
oh yeah, i wasnt about to do that
well then how do i get it on multiplayer?
cause the one i had before that WORKED woudn't work at all
You just have to understand how multiplayer works
my main problem is just getting the errors to stop sending
cause all my widgets are giving errors
Easy, just remove the code in question
so how do i debug
Only proposed to get on a call and neither of us are down to help in calls
At least not me neither@whole grove
I mean no offense, but debugging is a -crucial- skill in game development. Luckily, this sounds like a fantastic opportunity to learn.
it keeps saying my add to viewport is throwing a none
thats what happening to most of my widgets
That's unfortunate
OH laura i started using breakpoints in rider with editor
what i've been seeing is that all the return values i have, no matter what they are, are throwing none
so whats a breakpoint, might I ask?
you know what i've always wished error logs did? Told you WHY IT AINT WORKING
its weird #multiplayer has an interesting convo
It is literally telling you though.
You are doing something with "None"
.....
alwayshavebeen.jpg
Perhaps you're trying to add something to the viewport on a server, where there is no UI to add
only if you are around
If they run as client, it can.
Take notes @whole grove
Ok, this GAS plugin is absolutely worth the cost, holy cow.
The one that handles the Boilerplate™️ for you?
Not before xmas is over 
GAS companion I guess 
okay, so i figured out where the problem is, now its just a matter of fixing it
I don't think I've ever NOT seen a boilerplate system to some extent
Our guesses helped, magnificent
the problem with the health bar is that its not triggering the UpdateHealth_WidgetBluprint custom event
the target is invalid AKA not giving anything
so how can i get it to give me the right thing
cause it triggers it, it just aint running
okay, got the widgets fixed, tho im using a current health bar that you might have to explain how to make multiplayer cause its for singleplayer (its a whole different system)
plus its the one i was using so i actually understand it
closest message to ping you at 🤣
learning from tutorials is probably the worst idea ever
because they're designed for you not to learn jack shit and just to follow them in a pinch
lol i learn quite a bit through tutorials
so it works fine on singleplayer, but as soon as I try to use it on multiplayer it says that it "accessed none trying to read property UI Bars" at Set Health Bar Info. Im using the play as client since i figure multiplayer is multiple clients and not a listen server, whatever that is.
That sounds like whatever code you're using to create / display widgets is also being run on the server, in which case, won't work as dedicated servers can't have widgets created on them.
hmm okay, so how do i NOT run that on the server?
UI should be done locally, but information used by the UI needs to be in a place accessible to the client
playercontrollers are both on the server and on the client, so if you store information there, it can be pulled by both, though clients need it replicated to them
it seems like everything is run on the server
mhmm, the server has master copies of everything, clients get data replicated to them
where would i do it to run the UI locally?
controllers can call widgets to be create, you just want to make sure you put any code that does that behind an authority check or is locally controlled check
Whats the most efficient way to add an element to a replicated array of structs?
For example if add an element to a replicated array of structs(struct contains 10 doubles) with default values it takes 80 bytes
cause yeah, rn i have all my widgets in my controller
and i just used is valids on the others to get rid of errors that it gave me
so, let's say you have health stored on the controller as an int. playercontroller exists on both the server and the client, and you need to replicate data downward from server to clients. you should rope off any code that is UI related from the server so it doesn't run it (it doesn't need to). a good base flow would be playcontroller spins up the health UI element behind an authority check and checks for remote only (this prevents the server from running it), it grabs a replicated variable from the PC as an int called health with a rep notify attached to it. it starts full health, but the server calculates a damage impact and lowers the health variable on the SERVER version of your PC. it will then replicate this new value to you. when you receive the new value, the repnotify goes up. in this repnotify, you can locally run any event that you need to update your health widget.
rep notifies, iirc, are only run locally on clients that receive the replication
you can abstract this concept to other things, bullet amounts, etc.
I-
SORRY yeah laura is right too lmao
Is it possible to get that in tutorial version?
i don't know one off the top of my head, sorry 😦
Also unless reasons, I would store health on the PS or Pawn
Okay well I'll try to figure it out. I can't do it rn. Heading to church
YES wiz is also right, where you store this info is important, if you store it on the pawn, it is initialized when the pawn spawns and is only active for the life of the pawn, which is the way it should be
but still yeah, just keep in mind certain things only exist on the server, certain things exist only on the client that owns the object and the server, and certain things don't exist on certain clients (i.e. they can't see the PC of other clients, nor can they see the GameMode, those will both give you nullptr), and UI is driven locally through locally available data, and the server versions of things can and will desync from what happens locally, and you need replications to keep things together
If I would guess it wouldn't work with "run PIE under one process" is on
So turn that off
makes sense
i actually launched the editor through steam by launching vs through steam lmao
it doesnt work, big surprise
You should be testing through standalone anyways
How would you seamless travel in editor
Turning that setting off is like launching standalone
So you're not saving yourself time here
i THINK, not 100% sure, but they just figured out seemless travel in editor with 5.1
LMAO
but that DOES not matter
It's experimental
yeye always do stuff standalone, it's the most consistent
Anybody know why i cant edit this in the DataTable?
Nvm
I will know once I figure out why this is in #multiplayer
How about plsStandalone()?
Hello, I have a problem here and need some help with it, I made a video of if (Easier to understand). I am spawning projectile from a turret and for some reason the spawn location/transform doesn't work as it should. https://www.youtube.com/watch?v=SXEZZsMY8GM
Does anyone know why my host sees the client character animation jitter, while the client sees both characters smooth as butter
depends what you mean by animation jitter
one thing to check is if your framerate is just being throttled for the whole window
the code you showed seems correct - but you didn't show the code which is rotating the turret, which I assume is wrong, it seems like the server's version of the turret is just not rotating
Alright kids here's a doozy. Look in the bottom left of this image, here is my nightmare. Under normal conditions, I have about 400 of these little actors moving around just fine at 120FPS. However, if they begin to die (destroy actor from any source), there is a small chance that performance absolutely tanks to 30FPS within the span of 1 second. I have tested to be certain of this.
I replaced the code so they don't path at all, just move in a straight line to 0,0,0, problem remains.
These are Replicated and ReplicatesMovement, I am playing as a Client.
I turned off all movement, so the only code running is as shown, the problem remains
- Test also in singleplayer
- Use session frontend or insights to profile the game and inspect what is causing the hitch
Look for the game thread, most times the cause of CPU stalls or waits in other threads is due to that one being slower
It seems it is inside a "RotationFunction", does that sound familiar to you?
Is that the frame(s) where FPS are really low?
Yes it is slow there
I don't have any idea why the tick event is executing something so expensive there, since the only tick on your graph is getting random numbers.
I believe that clients are trying to tick an object which the server has destroyed
because the same overall issue happens even if this Rotation function is turned off
Mmm try to do a validity check before tick
Ahh that makes no sense
If the client object is still alive, ticking it should be no problem
almost all the cost is in "Self"
What about using an actor manager that selects and kills one or more units each tick? It would be mostly the same logic but cheaper since a sigle one needs to do it.
running validity check changed nothing
already tried that
keep in mind, 95% of destroyed actors do not trigger the meltdown, only a small percentage do
Also, I found that running the Editor as not a Single Process fixes the problem
I'm not able to see the issue, usually when I see "self" I try to write my own scope cycle counters (in C++) to get firther information about which lines of code are exactly slow
MMMM that is interesting
It might be a non-issue in packaged game
Worth testing probably
even if that's true, this is a very early project I don't want to develop a whole game with this bug plagueing testing 😦
And I'm almost positive the problem has nothing to do with my code, I've stripped the code all the way down to just "destroy actor" and that alone triggers the meltdown
I appreciate the help though
mmm what's inside it?
Usually if the game thread is waiting, it will CPU stall too, afaik. It is not an scenario I've seen much, but it happens in my project now due to using lots of multiprocessing and Mass in other threads, which has freed the game thread a lot
yep, to me it seems like nothing to worry about
Have you tried to remove partial parts of the kill code and see if the problem persists?
No, I mean
Have you tried to just call the random node and not killing the unit for example?
Yes the bug will not occur in those conditions
Ok, then it is kind of clear where the issue might be. Any logs on the debug output?
Also, have you tried to run the project with a debugger? Not sure how that works in blueprints
debugging in blueprints means "put print strings all over and forget about them for months"
nope, that won't be useful 😅 In C++, running with the debugger will trigger exceptions/checks that might only cause hitches in the game and point to what issue was the problem
well after like 8 days I think I fixed it, if you google bandwidth they give you all these copypastas to put in your INI files to make your bandwidth over 9000, I just deleted them
thanks for holding my hand through this trying time
Ok that was all wrong
I have reproduced the problem
and have an even better answer
If I open the blueprint and select a debug object, and that debug object dies, THAT is exactly what causes the bug
This holds true even I close the Blueprint
Seems like an engine bug but also seems impossible that nobody has noticed this before
Merry Xmas Everyone, Just a quick couple of questions : )
1 : Does OnPostLogin fire everytime a person joins a game (Even in standalone mode?)
2 : Why does this clear the UI on the Server Screen but not the Clients?
I am gussing HideUI needs to be replicated from the PlayerController
Please bear in mind this is all testing and working out what is doing what so I do realise this may not be "Optimal" or "Ideal" at the moment its so I can get a clearer understanding of what is actually happening. 🙂
- PostLogin calls when a new Player connects and successfully logs in.
1.1. This will not be called on Seamless Travel. - PostLogin is a GameMode function, this only calls on the Server.
Ahh ok that makes sense.
What you are trying to do there with the UI has a better place
Thank you, I took the plunge and bought a Starter Multiplayer Project from the Unreal Store to see if it could shed some lightbulbs moments.
But requires some simple C++ Code
Also unless you have the UI referenced in your GameInstance, calling this on the CONNECTED player to clean the previous UI is wrong
Cause this is a new PlayerController
Not the one that you had when you pressed the Join Game button
So everytime a player connects to a lobby it creates a new player controller?
it doesnt auto-reference the one the player was currently using when he clicks Join Game?
Yes, HardTravel (connecting/disconnecting/hosting/etc.) as well as a Seamless Server Travel to a Map with a different PlayerController class will cause the PC to be recreated.
That counts for almost all Classes
never realised that.
No, at that point the Menu PC is long gone
Better to clear the UI directly when you press the Join Game button
But overall, exposing APlayerController::PreClientTravel from C++ to BPs would be the better solution
im scared to touch C++ i tried to use it from course in udemy and tutorials on youtube i couldnt get it to work, I done some C# and VB.NET lol as well as web languyages before. xD
Be aware that Multiplayer without C++ is going to be a fight
What a simple gauntlet style game?
Doesn't really matter
A lot that is Multiplayer related doesn't exist in BPs and often has to be hacked around or can't be achieved at all
Means eventually you will reach that "end" of BPs
Ahh ok so you have to kind of mix and match with Bp and what isnt in BP you have to reate yourself in C++
Yeah or simply use C++ directly
The documentation for multiiplayer or UE in general seems to be pretty bad and trying to find a upto-date book or something to work from is nigh impossible 😦
Tbh not much has changed in terms of basics
So as someone who kind of understand blueprints to a degree the multiplayer is a sea infested water xD
Need to pop out for xmas dinner with the family, Thank you for the information. I need to research this a bit more I think. 🙂
Drib, biggest helps to me were the ownership of objects and understanding the RPC / variable replication options
I have mmo style game with dedicated server. I want to create guild/clan/tribe system. I have "map variable" in gamemode that contains tribes and data. What is best way to get variables from server to local widget. in this case playerlist? First 2 images in player controller. Second light blue from local widget.
and this calls it in local widget
GameMode exists server-side only. If you want to transfer data from the server to the client, activate an RPC call (Event -> Replication, select the correct one for this particular call. Multicast will trigger it on all clients + server) on an object that is owned by the server and the event will trigger on the networked pc. Attach your data and once it's inside the client display it on screen as you would with a non-replicated variable
option 2: set Replicated=true on the variable (again, NOT GameMode!) and it will automatically keep the value the same across all devices
the PlayerController is probably a good one to use for this (not 100% sure if server can send RPC on PlayerController), since each client only has its own PlayerControllers. Meaning if you Multicast from there, it'll only be executed on the server and on the owning client
@thick jungleThat what I did in those pictures works 100% to get data from gamemode. only problem what I see is somebody could call that (local widget) event DDOS style and crash server.
Use Replicated=True on the variable then if that's your concern?
you mean that variable in Gamemode what i'm trying to get to local widget?
again, not gamemode. but yes, exactly
Okay thanks!
There is no such thing as a GameMode inside the client 😉 it can't replicate to something that doesn't exist
okay 😄
glad to hear!!
Like it seems jittery.. idk it's like the animation itself, the movement seems okay.
It's only on the server, and the simulated proxy for the client is what's jittering. The server character is smooth on the server.
On the client, both characters are smooth.
The only thing happening is basic WASD movement.
What do you mean by the framerate being throttled for the whole window?
I've read in some posts that it could be because the server ticks the skeleton's animations only when they receive network updates, and recommends setting bOnlyAllowAutonomousTickPose to false on the mesh, though that makes the animations tick really fast and it looks like they are played in fast motion.
But I've never seen this before in multiplayer, and it's literally with a new 5.1 project with just movement and an IdleWalkRun blendspace
Ohhhhhh I think your right
I’m doing the rotation on the client not on the server
Thanks
@thick jungle Thanks for the reply, I was looking at this multiplayer project on Epic i got for a few pounds.
This is inside the Character not the controller
As i Understand Executes on Server = Execute this code ONLY on the Server so no clients.
Executes on All = The Server will run this logic on all connected clients. , Run on Owning Client = Only execute on this client? , Multicast = Server send to ALL clients.
As you can see there is some mixup between Executes on All (How can a Client have a Execute on ALL command) when Client A cannot talk directly to Client B without it going through the GameMode(Server) ?
Multicast could be somethging like Player X has been killed by player Y to all connected client chatboxes i assume ?
hey i guess this would be best place to ask about replication issues?
thats how i see it. its a socket.emit rather thn a socket.reply
Not sure at what point you would use "Run on Owning Client" if all data has to go through the Gamemode(Server) before being accepted. (Example Server does the player have enough ammo to keep firing? Server replies No, Player cannot fire anymore so this would lead to from what i guess a scenario of
Client requests from Server (Run on Server) "PlayerAmmoCount" Server returns 0 to the Client -> Run on Owning Client (Stopfiring)
@cloud stirrup I recreated MSN Messenger many years ago using Socket's and TCP/IP connections and stuff but the wording of some of the replication commands are a little confusing i find.
run on owning i guess is a way to allow the playe to have auth over that event or whatever was spawned?
eg while in a cutscene maybe?
idk though im nowhere in depth but from how it reads as a thing i assume thats its uses.
I guess it would depend as the player could run the cutscene without the "OK" from the server i guess
like for example in World of Warcraft - Did player kill final boss (Run on Server) -> Yes/No - Server replies Yes (Run on Owning Client) Cutscene
Im really new as well so i am guessing myself.
thats my thinking
Theres a good PDF UE4 Networking Compendium I read to start
run on owning has no effect else where. so last night i was messing with it. if it was set owning client it didnt set player to ragdoll when shot by any client except if it shot itself. on server it did as expected except ragdolling was inconsistent accross all 4 windows. to the point for client a. it was at x1 y 1 b was at 1 0 c was at 0 1 and d was at 0 0 for example. so you couldnt say for certain to a team mate the body is anywehre XD
and this came from a server side "player hit" blueprint
lol i wish i could help you with that. xD i can barely get 2 players to connect to each other atm XD
using 3rd person or 1st person example?
1st seems messed up atleast 3rd person seems to replicate properly
3rd person I can do the Create Session, Join Session, Find Sessions and Open Level atm
idk if its project settings or something but its not 100% there
im going for a dedi setup which i know is a pain to do with src unless theres a trick in editor on epic
So now I am looking at how do i create a custom lobby like for example in Dead By Daylight the player goes from Main Menu to Play as X to Find Game to a Lobby Area where they are with the other player to then loading the match map after all ready up
flow would be menue -> load local player details -> register player to lobby -> save player state to level loaded into. idk exactly how to do that myself yet but id probably be intergrating a db or json storage to do that.
chat gtp for all your every issue XD
🙂
picture to reference my issue. all 3 in a different place 😦 i dont even know where to begin other than iv explored all various combinations of replicating. autonomous proxies and other stuff.
obv that means transforms are not synched
yeah i guess i cant just ragdoll it then as i am il have to have a death anim / phase that guides it to a set location to die off. verified shot placement replicated fine
can't you just continue to synch to root of the mesh even after ragdolling for like 5 seconds or something.
that works too. i'm more familiar with unity though but I assumed you had control of when you can stop synchronizing the player but it seems like Unreal automatically unsynchs when physics are turned on. what you said works but it may get weird results like the ragdoll teleporting or doing a weird interpolation
ahh so soon as i set phys its random i see. il keep trying other things.
until its wrong
Confidently inaccurate
wrong is such a strong word 😄
anyone know exactly what bIgnoreClientMovementErrorChecksAndCorrection does? As in does it stop correcting client moves on the server side, or just ignore server corrections on the client side, or something else?
yeah exactly
It stops correcting moves on the server side, this will lead to movement desync though if used for long enough, you can combine it with the “server use client position” (something like that) to get client authoritative movement
sure i like that more XD. its been 90% good so far. least its putting me in right direction with a lot i ask @fallow shadow
fair
ok, thanks for the help
found an option that may work
it stole my credit card. jumped right out the screen and ran away
Hi guys, just a quick question, if a client can connect directly to a server using server address, how can the server block or close that connection? (for example, because of fail login credentials)
PreLogin in GameMode is meant to take care of that
Thanks mate. I just found the answer on Reddit. It's funny how I couldn't find the answer after a whole week searching but always get it within hour after asking here. Truly magical.
**22 mins, and it could have been seconds if I noticed the question by the time you asked 🤧
LOL, thanks, better 22 mins then never 😋
Btw, here is a question I couldn't find the answer, how do you make 2D spatial grid node in replication graph use pawn's location instead of view location for distance calculation?
I don't use ReplicationGraph, but it shouldn't be that different from how you would do it with the regular relevancy system.
I answered that a while ago
This is the code you want to mess with: #multiplayer message
And well you can't override that code very easily, not if you don't have a custom source build, so you instead override that in IsNetRelevantFor for example
Thank you 🥰 . I actually tried to modified the 2D grid node provided by Unreal, but it didn't work so I ask here to see if someone had done it.
Or w/e the corresponding function for the RG is called
But pretty sure it's the same, as it's called on actor
Yeah, after reading it I realize I have the modified the engine relevant functions to make it works, so your approach will be a better solution for sure
Thank you for your help 🐣
btw, Merry Christmas 🎉
Anyone have a moment to help with replicating a bool? I've been pounding my head for about 3 days on this one. This works exactly as intended for the server connection, but the client pretends that it isn't even though its printing true. sec for screen shots.
this branch will run false and use the item further down the exec, rather than selling an item as intended on client
Is the inventory manager component set to replicates true?
i think i may have just solved this problem actually, by creating a server event and calling it rather than the bool node xD, and apologies (edited) yes its replicated
if a client pushs enter key to switch to next level, other clients all should go to the next level.
How can i make them?
help me~~!!
Perform a server travell
if you want to switch to another level, the host, and all clients must also switch, if you don't then you basically disconnect. This is my understanding, but i'm still experimenting with this one
Hello, I was wondering how to implement chat, do people integrate external services like xmpp servers?
it depends on what your requirements are for a chat
you can pretty much have an in-game chat without third party solutions just using unreal rpc system
I noticed some convos in March between Vori, Exe, Kaos, all you multiplayer experts, all talking about handling sprinting in the CMC with a GAS stamina attribute. There were a lot of ways suggested to handle it.
I'm up to this right now (I have a sprint toggle on a custom CMC) and while sprinting, I want a GAS stamina attribute to drain.
What is the most up to date way to handle this to try avoid double RPCs with GAS and CMC?
you dont need an ability, just a native action in this case.. you can have your stamina attribute overriding base value locally using cmc's prediction, which is what'd work the best if you want accurate stamina prediction
But all the attributes that have to do with movement are always going to be implemented better in tandem with the cmc
Can also do a GA, but you wouldn't save a single RPC
I'm trying to get this weak obj ptr captured by this lambda but it is always stale
TWeakObjectPtr<UFw_OverlayComp> tmpCharWeakPtr = this;
auto Lambda = [tmpCharWeakPtr, tmpDuration]()->FAsyncCoroutine
{
co_await UE5Coro::Latent::Seconds(tmpDuration);
{
if (UFw_OverlayComp* tmpOverlayComp = tmpCharWeakPtr.Get()
{
}
}
};
Lambda();```
So 🎵 is now labeled as #multiplayer ? @whole grove
Maybe after you figure out what 🤧 really means
A man has many faces
That could be one of them
co_await pls()
It's okay, it was a payback we had to take 😔
@whole grove the tmpCharWeakPtr is just not labelled right. It's an actComp but I wrote that Char instead
It's the terms that throw me off sometimes. Scope I assume means the new row of brackets?
Having tiers throws off lambdas
hey, im currently working on a steam server browser and im wondering how i can display the ping from the server in realtime. It would be great if someone could help me. I already managed it to get the ping but i want to update it in real time
you can query the value on a timer at a frequent rate
or.. - sight - create a coroutine 🙄
I saw that, and gotta say GJ Laura
really appreciate the effort will actually give it a try now 😄
By giving it a try you mean writing an article on how it's used in #multiplayer ?
One liner articles are cool too
haha lol "where/when to use it" is a good type of article
use case examples and the benefits
do you can show me an example? Im quite new to unreal it would be very nice
better do a timer PoxhYT
I can't with these two xDD
I'm not using an ability for sprint, just the CMC. Could you elaborate a bit more on how to have your stamina attribute override the base value locally using cmc prediction?
Also are there any articles written on this? Couldn't find any, I'll check pinned though
which timer should i use?
No there's no article written about this... been annoying kaos for him to write about native actions but he's busy
there are multiple options
there's a function that lets you override the base value of an attribute directly without the need of going through of a gameplay effect
I dont remember the syntax rn but it's there
BPs: Whichever you like (but by event is better)
Have you checked the GAS Sample Project by tranek? AFAIK it covers that
So i created a binding to my ui text and im not quite sure how to use the timer properly
No, this is terrible Wizard
Interesting, I added sprinting to the CMC as I thought it was needed to go there to use the FSavedMove_Character queue
thanks, will look it up 😄
check a video about timers from Matthew Wadsteim to learn how they work
tomatoes??
the way you did it is the best way you can do it 😄
What Wizard suggested is pretty terrible as its a pseudo ticking ability waiting for net sync to ensure a prediction window... not needed.
okay phew hehe xD. there's so many ways to do things lol
And it was not me who suggested, but tranek 🤧
Wizaaard.. you dont do that xD
what class should i use if i wanna initiate a rematch and what would be an ideal way to do so?
hey, does anyone know how to get the players current ping
where can i find an example for this?
or can you give me an example? It would be great
yee one quick second
sure no problem thank you
you can use the player controller to cast to the player state
and then you have it as a variable in state by default
GameMode
ResetLevel should be the most straightforward
Or you could seamless travel the players again to the same level if you find it a hassle to reset a lot of actors to their initial state
i was ltrly trying to kill all pawns and have their controllers spawn new ones again
so stupid
thank you so much
Nah, no need to kill actors really
reset level somehow doesnt cut it; i believe its because im spawn players on login rather than on begin play?
ResetLevel calls Reset on all actors basically
It's up to you to define what Reset really means
So calling ResetLevel is 10% of the work is done
ah
okay
that makes more sense
do all the actors get destroyed?
or do i need to do it seperately
Again, no actors are destroyed
They are just reset
If you want actors to get destroyed then just seamless travel to the same level again
Most actors will get destroyed apart some that persist
What would be the best way to update the UI of the player (clients and listen server) via OnRep? Is it even possible, if not, what's the best approach?
void UInventoryComponent::OnRep_Inventory()
{
if (AMyHUD* HUD = Cast<AM>(GetWorld()->GetGameInstance()->GetFirstLocalPlayerController()->GetHUD()))
{
HUD->UpdateInventory(Inventory);
}
}
That function won't work for the listen server
Event dispatchers / delegates
OnReps are quite good, and you can go an extra step and use delegates for decoupling UI from gameplay code
The reason the OnRep not firing on server is because that's the nature of OnReps, they don't fire on server
You will have to fire it automatically when you change the property
And FYI if that property you're changing is not OwnerOnly or you don't take care of it affecting the owner only, then the HUD will update for other clients as well
Ty
I'll try the delegate route, thanks for the info
Delegates are not a substitute for OnReps though
Broadcasting a delegate on the server can only be listen to on the server
Same for when it's done on client
i.e. delegates are local
What @fathom aspen is trying to say is that it's a different design pattern
How the networking is done... doesn't matter
the class that gets the data from the network will fire a delegate that the UI subsribes to
every class has its modular functionality, less calling and casting to different classes from other classes, those are tightly coupled dependencies that are bad
MyInventorySystem -> Delegate: OnInventoryChanged. UI can subscribe to that. Whether you change the data through onReps, RPCs, doesn't matter
Subsystems are particularily easy to work with that if you are doing a lot of things in BP, because you can easily grab the subsystem from BP without much fuss
Ok...I think I got all of that, I appreciate all of your help. I'll see how it goes 👍
The AIController only exists on the server - does anyone know off the top of their head where I can find the engine setting this to be the case?
Hi!
Is this how a client connect to a server?
Programming with Unreal Engine, Houdini, Math, & Graphics
Thanks!
Inside APawn::SpawnDefaultController they check that the NetMode is not NM_Client
Yes
It's really interested. You could pin the message unless it's already pinned.
I don't have enough powers to do that, and if I did I won't because it's already mentioned in the docs
Which docs?
This is the first time I find something talking about connection flow.
The official ones
Oh. I haven't searched enough. Sorry.
Also the one you sent is very particular to UT which wouldn't be good enough to depend on
But could be an example
Thanks a lot.
Thanks, it looks ugly yeah 😄
UT?
Unreal Tournament
Oh, I played that one.
hey, im wondering why the name contains a unique id or something . Is this the correct wy to get the current steam name?
ANybody remember how to get client-side-only pawns to update the server's location for the player for purposes of net culling
Yeah, but doesn't work in PIE
anyone found a way to just "not apply" server location corrections client side on characters?
Overriding methods like ClientAdjustPosition_Implementation and selectively calling the super version on the character movement component can nearly do it but I'm finding that velocity is still replicating and being applied to the character for some reason. Does anyone know how to either stop this velocity replication, or if there's another way to stop applying the server corrections altogether on the client, not on the server. (I know this will absolutely lead to de-sync, but for my situation that's ok).
These booleans may help you out if you're using the character movement component.
I should have specified; I am using CMC, except those variables stop corrections on the server (making it client authoritative). I'm looking for something that will simply ignore the server's corrections on a specific client's side, yet on the server it still has authority and will correct invalid moves the client makes
*on the controlling client's side
**on a specific client's side
i wonder if you could achieve this by clearing the SavedMoves buffer
not sure though
issue is my use case isn't actually really on the client that's controlling the pawn, it's basically for a knockback related thing and so just changes the velocity of the character
I did still try not allocating new moves but it didn't work unfortunately
make sure you override Character rep stuff too, not just CMC
theres some correction stuff in there as well
ok so
the only functions that I can really find to override are the previously mentioned ClientAdjustPosition_Implementation and PostNetReceiveLocationAndRotation on the character, yet the velocity sync thing still happens. do you know if there are any velocity syncing related functions by any chance?
hmm
if you override PostNetReceiveLocationAndRotation, then that should take care of the base AActor movement replication from server to client
if you also override the ClientAdjustPosition i'm not sure where else it's updating velocity from 😂
overriding those 2 is basically like turning off movement replication entirely
anyone have any experience with swimming and setting movement modes from the physics volume? Any time I attempt to do this it forces all connections to swim. I've tried to call this from the actor overlap, from the character itself and calling event, and from the game mode calling event. It just forces everyone to swim
is it possible to nest servers? and by that i mean client send->local server send ->main server (authority)->to local servers->to clients?
What data are you sending?
ANybody remember how to get client-side-only pawns to update the server's location for the player for purposes of net culling
So I started draining a GAS stamina attribute on the server while sprinting in the CMC. Does anyone know how to make this GAS stamina attribute predictive? Currently just doing it on the server as I can't figure out how to make it predictive. Safe_bWantsToSprint is linked to the FLAG_Sprint custom flag.
float UMMOCharacterMovementComponent::GetMaxSpeed() const
{
ensure(MMOCharacter && MMOCharacter->GetAttributeSet());
float MaxSpeed = Super::GetMaxSpeed();
const float MovementDirection = FVector::DotProduct(MMOCharacter->GetActorForwardVector(), Velocity.GetSafeNormal());
bool EnoughStamina = MMOCharacter->GetAttributeSet()->GetStamina() > 20.f;
bool CanSprint = EnoughStamina && (IsWalking() || IsSwimming()) && !bWantsToCrouch && MovementDirection >= 0.95f;
if (Safe_bWantsToSprint && CanSprint)
{
MaxSpeed *= SprintSpeedMultiplier;
if (MMOCharacter->HasAuthority() && MMOCharacter->GetAbilitySystemComponent() && MMOCharacter->GetAttributeSet())
{
float StaminaDrain = 25.f;
MMOCharacter->GetAbilitySystemComponent()->SetNumericAttributeBase(
MMOCharacter->GetAttributeSet()->GetStaminaAttribute(), MMOCharacter->GetAttributeSet()->GetStamina() - StaminaDrain * UGameplayStatics::GetWorldDeltaSeconds(this));
}
}
return MaxSpeed;
}```
Applying a Gameplay Effect is the only way to predictively change a GAS attribute
I did something similar with blueprints. I check if they have enough energy client side to do a dash boost, then I do the dash boost client side if they can and spawn particles and add sound.
If they don’t have enough energy I show this on the UI.
Then on the same execution chain I have a RPC with server side validation to check the same amount of energy and do the same dash if allowed however if they aren’t allowed to dash I teleport them back to the last known location and set velocity to zero. This should only capture cheaters because honest players would fail the first client side check and never send the RPC in the first place.
I take it back, you can do your own prediction like lawlster. But to use GAS's built in prediction based on prediction keys you apply a GE
But yea I’m not using GAS…I’ve heard good things though.
I would apply an infinite duration GE and remove it when no longer sprinting
When i put 2 players in playable mode as Clients, After Equipping the weapon , crosshairs are getting for the 1st player and 2nd player who equips weapon their cross hairs aren't getting visible and sometimes vice versa...Can anyone help ?
Ahh interesting thank you, that could be a good idea. I did hear that using GAS with CMC like this causes a double RPC, so trying to keep it in the CMC without a GE helps avoid the double RPC, but still looking into it. I'm gonna test out your idea though, I like it
made a topic, seems like this has no solution, should I give up?
At this point I'm starting to think making use of that HTML5 plugin for UI was a better idea
Yeah I think you'd have to use one or the other, as the CMC has its own form of prediction.
I haven't tried using a GE to change movement speed so if you do get rubber banding, it could be that you're breaking your prediction window and you might just want to predict it via the CMC.
I don't forsee any real issues though
As a side note, if you use effects you can give granted tags like Movement.Sprinting and you can use the tags to block other abilities from being applied and eliminate the need to use conditionals to check states
Yeah apparently epic was working on a way for GAS and CMC to coincide but it was abandoned when dave left, RIP! & ahh thanks, when I test it out tomoz I'll keep that in mind.
sounds like a great idea to simplify things, thanks!
Haha yeah thats too bad. Cool, let me know how it goes!
im alreading overring PawnLeaving game to not destroy pawn when player leaves
but it will destroy PC anyway yes ?
what about PS ? I need something other than pawn to keep my data available even if player left
nah, stamina is better predicted in the cmc
