#multiplayer
1 messages ยท Page 180 of 1
I know about github
I like Plastic
how big are the actual files that matter?
all the ones I didnt tell you to try deleting
config, content, source, the uproject
content is the only one with any size to it
files that matter:
Build
Config
Content
Plugins (if you use plugins)
Source (if C++ files are present)
*.UPROJECT file```
:|
it's fast as hell
It's fuckin NOT lmao
and less of a PITA than Perforce
IDK, my stuff syncs up in like a suspiciously low amount of time compared to Git or Perforce
You literally have to break up your checkins into tiny bits and do them in specific order
or it shits it's pants
I hate plastic so god damn much ahahah
it is so close to being amazing
How big of a checkin?
yet so far away
perforce ftw ๐
I don't do anything above like a few gigs, I don't just slap megascans in a template and call it a starting point
Literally 250 files+ and you start having issues
especially on directory moves
amen
perforce can be a pile of shit too but it's the least pile of shit out of all the source controls
I have genuinely no idea how anybody gets any work done without multiple changelists
it was a pita to set up, but everything beyond that has been smooth sailing for me.
251 file test took 3 seconds on this dell optiplex
It's the actual checking it in that's the problem
you start getting errors if you don't do it in the order it likes
what order?
It's smthn stupid like it likes removes first, then changes, then adds
because their checkin code doesn't do the logical thing and just process it in that order
yeah that shit annoys me to hell
testing with 850 new files 350 megs or so
and when you are doing really really big changes, like 1000-2000+ operations at once the automatic reconcile often just ends up getting stuck hardlocking the GUI
drives me insane
It's an issue more with existing files than new ones
hey at least it actually still works unlike svn which has been broken since 5.4 preview xD
lol rly
yeh
IDK, other than the odd move detection problem it's been absolutely butter smooth for me
I just do my work, hit checkin, done
tbf i've done some weird shit in some of my test projects and while following tutorials and stuff, and i feel like perforce just kinda... takes it and keeps going XD worst that happens is you mess up your own files, and if so you just roll back and do it again.
the only thing about perforce is the stock reconcile is unusable
it's so bad
but u can just not use it and then ur fine
how so? i havent experienced anything weird with it.
it's slow as shit
oh that... yeahhhhh
I use Zebs one
works sick
I'd use perforce but I kept bumping up against the 5 user limit and decided eff it
plus the self hosting is def. dangerous for me
Was a pita to setup, once I got it setup it was a breeze tbh
oooh it even ties in to the context menus n shit? das neat
why dangerous?
Because I barely know enough Linux to be dangerous, and didn't feel like bothering with my own cloud server etc
ya it's sick can literally reconcile this entire workspace
1.2 seconds
gg
It was fine, and what I'd use if I had money and a real team
i dont know any linux, i run it downstairs on an old second hand dell poweredge running windows.
use tailscale for networking so u dont have to do port forwarding shenanigans or expose your network more than necessary. ez days
@fossil veldtYou doing a networked factory game?
i'll just hide behind adriel XD
Whats your approach to keeping things in sync when the data flying around is far beyond just being replicated?
just don't rep it
Just RPCs for looking in inventories etc?
and replicated end results like something changing state or popping out on the ground?
I use replicated TArray with dyn rep condition
How would you approach what I'm working on? It's very similar to a factory game except its fully continuous and not discrete. Power/signal networks.
My logic runs on counters and is built so you can accumulate it at once
so if stuff goes off screen you just stop running it, when you run into frame it calculates it all at once
then you get the rep
Don't really know enough context tbh
1D physics sim with power, drivetrain, signal networks
What needs replicating
which states must be synced
as in which things break the gameplay experience if both players don't see exactly the same thing
I want the gameplay-relevent and cosmetic end results to be consistent. Take a vehicle for example.
Movement of the vehicle would be server authoritative
Cosmetics of the vehicle (tire spin, sounds) would be local, driven by the sim
the sim runs everywhere
But a problem I'm running into is there's parts of the sim that are not 100% predictable but do have gameplay relevent consequences
How many vehicles are there
5-10 vehicles with up to 100 parts each
way too much to replicate it all, it updates at a very high frequency
Maybe just do state syncronization
Yeah I'm thinking something like that
for continuous stuff that'll work, like say throttle
network prediction plugin prob can save u lots of time here
maybe honestly even mover might be a shout ngl
Nah it's all physics
so what
The main problem comes when the analog domain mixes with events
since it's all analog, even your controls, things like FireWeapon is a trigger based on a signal network value
You seen?
Might be what you need
Yeah, might get into that, might not. The movement works fine with the old replication style, and ping lag isn't really a problem. I'm talking about stuff like triggers, things which turn continuous signals into events.
For example, Cockpit -> Engine -> wheel is totally fine. All I need to sync is throttle value and resultant physics, everything else can run independently
Cockpit -> Engine -> transmission -> wheel
-----------^-signal---------^
is trickier. Just syncing the 2 signals isn't enough, I have to sync the state of the transmission (what gear it's in)
disagreeing on the rpm of an engine is fine, disagreeing on what gear a transmission is in is not
so I think i need some sort of list of properties that are replicated, and those that aren't. Hmm
It all runs in a bunch of subsystems so I'll need some sort of marshaller to push values from server to client worlds
Yea not sure tbh, it's so dependant on context, add me i'l chat you about it later, i gotta get back to work
Working late?!
Is it just me or does replication graph not support DormantPartial?
I'm reading through and it looks like it just checks if it wants to be dormant yes/no but never calls GetNetDormancy to ever evaluate an actors desired dormancy on a connection. Also, it seems like it's set on the graph itself rather than connections. How is one supposed to use dormancy per connection on rep graph..?
It seems there is a FConnectionReplicationActorInfo bDormantOnConnection so I will try setting that directly in my node I guess...
Is there any reason you shouldn't store the UNetReplicationGraphConnection in a graph node?
ye just finished
I don't like working in the day
I'm a night owl
there's gotta be a way to attach my character for client :/
Just attach it? If the attachment behaves differently with server or other client then you need to check what code runs on server and what code runs on client and why they don't behave in the same way. Eg collision is fine in server but not on client machine.
One thing to note here is everyone is running their own instance of the game. What to be communicated, what to do on host machine, what to do on client machine. That will be your design
I already repnotify setting collision disabled thats all fine
What are you attaching? And what's the actual problem
It will move it to the location but it doesn't attach the character and he falls through the floor (because collision is disabled)
You can disable the skeletal mesh collision
But not the capsule component
They will fall for obvious reason
And I'm not sure about attaching a player character, they already have in built movement networking. You might be fighting against the system
Maybe try to disable movement replication when you attached the player character
I have tried that
makes no difference and wouldn't the component not tick after its unpossessed anyway
Well those got nothing to do with player falling off the map anyway
If u disable the capsule component
Then they will fall off the map obviously
Maybe adriel knows something about riding a car
If I disable the skeletal mesh component instead wouldnt the capsule collision interfere?
I never try to do anything remotely like that
Well what I would do is make a new collision channel
Capsule still collide with ground, landscape w.e
But it won't collide with rhe vehicle
yeah i could do that
I'm not sure why it would work fine for server though
I think its more a replication issue. When client gets in vehicle I dont see him at all. If the client watches the server get in he teleports to the attach location and falls through. Server sees everything fine.
But i can try the collision, its possible disabling the capsule ruins any replication maybe
But also could be unpossessing makes it stop replicating
Ignore the HUD, I disconnected every node and I'm just using the 3rd person character pawn.
Why does my game auto-create a session and joins the 2 players?
I even created a brand new project, imported the third person character add on, set it for 2 players, and I got the same result. There has to be a setting I accidentally turned on.
@dark parcel So... setting the CMC mode to None as opposed to disabling tick for it worked. Thanks for your time.
ola folks.
Which way you prefer for a client authentication? Easy way through
AGameModeBase::PreLogin
or the big guys way using AOnlineBeaconClient(ALobbyBeaconClient)?
wym by joins the two players? Why would you expect this to not happen?
I guess I thought the 2 players started as if they were on their own machines and you had to create a session and have the other join to have them in the same game session..
change netmode to standalone?
and you have to have the map open that has your menus unless you have it setup for the same level
however your setup is idk
@dark parcel ok that was the dumbest issue ive had in years...
im my head the issue was that the anim bp couldent event read replicated values or recieve info from when a server would have a variable from the server side to the client somehow,,
but i just have to do a regular replicated varaible on the player and change it via server and it could read it just fine (like everything else)....
@dark edge
I believe they do put it on the playerstate but they use a proxy to replicate the data through the character for faster updates.
Yea ๐
The anim bp don't know anything about replication or networking stuff. It can however read the properties from its owner (which can be a replicated variable)
So yeah trying to do server rpc stuff or even any inventory logic in anim bp is clearly not the right move
Handled the variable in your player character or else where. Anim bp read the state and values from its owner
๐
I've figured out attaching the character to my vehicle but it works the first time but when I get out and get back again it doesn't seem to work. Any ideas why?
Hlo
Good morning
If RPC are called from controllers to make a pawn move or anything are they meant to be any limitations?
I used to be that way! Now I own curtains! ๐
Hi.
I wanted to use something much more lightweight (physics, bandwidth) than a character, so I switched to pawn with FloatingPawnMovement.
However, it seems the network support is missing (i.e. controller inputs sent to server, interpolation, correction, etc).
Is that right?
Should I:
A. roll my own pawn replication
B. use character, but try to make it lightweight
?
Why does it need to be "lightweight"? Character is already pretty optimised for the network
60+ player combat in an open terrain... the physics and networking together chew up the CPU
Well consider that Fortnite and lots of other games do 100 with CMC ๐คทโโ๏ธ
CMC is capable of scaling to 100 players
CMC doesn't use physics it's kinematic
I just want a smooth moving blob
characters use physics... interacts with ground right?
It's not part of the actual physics simulation, it's a kinematic mover i.e. all movement is calculated via the component
ah well when I profile, physics and network for characters are the heavy parts.
So I thought, use a floating pawn. should be lightweight
but... only moves on client
I guess what I'm trying to save you against is engineering your own solution when CMC already handles network movement pretty efficiently
But yeah, you would need to roll your own for anything other than character. CMC is the only one that has full network support.
and vehicles? projectiles?
Also nope
Maybe I can turn some bits off in CMC to make it lightweight?
Any actor can replicate it's movement ultimately, the problem is the prediction, reconciling, smoothing etc - which is what the bulk of CMC makes up
Vehicles are physics based usually so endlessly difficult
vehicles must do all that surely
Vehicles are usually interpolated and/or client authouritive
In my dedi server once I have 60 or so characters running around, the FPS hurts
yeah, it's not cheap by any means
ok thx @chrome bay - food for thought
i rolled my own network character movement / prediction and rollback... was quite tough to get it to work 100% and i wouldnt recommend it unless you have a very specific reason lol
well because I can use a sphere for my avatar - no physics, just hovers above the ground. So character seems wasteful.
Maybe I'll just get it replicating first without worrying about prediction, then profile to see how it compares to charactee
Just using a "flying" character seems the easiet way tbh
yeah i'll try that too, See if I can make character lighter
I saw someone made a multiplayer FloatingPawnMovement addon. Back in 4.x
Any one?
Is this good for shooting logic? I have been reading the compendium to improve my code.
i'm running into some replication issue that is confusing me...
Is there a difference between declaring a varible replicated in C++ as opposed to blueprints?
for some reason, get ability system component is only valid on client.
it is from an event that is called on server
im wondering if there's something im fundamentally not understanding abotu how replicated variables work
I vaguely remember GAS being a little complicated to replicate, there is a #gameplay-ability-system channel, I would try asking there next. I don't think the way your c++ code is setup currently is the problem. Hopefully someone can come along and tell you exactly what the problem is quickly though
I'm pretty sure setting up gas itself is like a whole thing
oh this has worked before i just wanted to move one variable from Blueprint to C++
it was working before i broke it ๐
thanks for the tip i'll ask there ๐
https://github.com/daftsoftware/FGMovement
you might be interested in my repo
What's a good way of replicating cosmetic stuff like hit sounds and particle effects? Will i have to use the server multicast method or is there a better way?
There's only two ways that i know of, rep notifies and multicasting. You can of course also spawn an actor on the server that is set to replicate with audio or a particle system
Hello people I am trying to replicate a jetpack feature made starting from lyra project, and I would like to know more about lyra multiplayer replication and how it works. Could you suggest some very good video about it?
are oncomponent hit events network replicated by default?
if I have a old pc or a raspberry pi , can I use it as a dedicated sever for a game? How much storage will be needed if I have 1000 - 2000 active players?
Why would attaching my character not work after the first time?
bro idk what to say
in order to get back to where I was
I had to delete the class that I had in plus that was crashing
I like that here are so many experts but no one really cares about your work and trys to help you for real just throw words on this chat
show how you're spawning this actor
if you're not spawning it at runtime, show other stuff like the door mesh components etc
you have 2 meshes, somehow
also you should be using repnotify for this
not multicast
why is door anything to do with inventorycomponent?
wtf is going on lol
its apart of this actor, placing the door actor by itself seems to not have the issue
yes
why is the door itself not the thing being networked through, why is it going through your inventory component?
it should be this simple
DoorActor:
InteractedWith -> set bIsOpen (replicated, repnotify)
OnRep bIsOpen -> do the opening/closing logic based on bIsOpen
Character:
Input -> ?????? -> Run on Server Event to interact with thing (the door)
RunOnServerEvent -> call Interact on passed in thing
assuming you have an interaction system
if you don't you can just directly call a run on server event OpenDoor(DoorToOpen)
yes all the interaction are going through the inventory component to set the interact widget
thats fine, it should stop at the door. The door itself can be replicated with a replicated repnotify bool bIsOpen
after telling the door "You just got interacted with", the character is done. Now it's all the doors responsibility
ok ill try that
figured that part out
What could cause the character to attach to vehicle the first time but when I get out and try to get back in it doesn't attach?
show code
well the first this I see it the attach component to component node is not even attached so therefore not being fired
look above it and the last two screenshots. That is old
Do you know right where the problem is?
what
at what node is your system breaking down at?
idk it all fires. It works the first time. I get in and attaches. I get out. Then try to get back in and he doesn't attach to the vehicle. It's synced accross both server and client but only attaches the first time I get in
I belive its an authoritive issue or something.
ok, so what id do is put print string on the end and keep moving it back until you stop seeing it fire then youll know where the problem is. it would take me good 30 minutes of staring at all your screenshots for me to understand whats going on
I'm about to test if spawning the vehicle with a spawner would make a difference as opposed to it placed in level. I noticed its owner is ai controller when its placed in the level
I simply see it all firing using the bp debugger.
so how should i go about using rep notify if I cant call the doorTime line inside of it
repnotify calls an event
create a event and in the rep function call that event and do the timeline
repnotify is just so it automagically happens when the bool changes
I understand that the CMC are not meant for the same thing but is there anything that the CMC can do that GAS cant? in theory...
myhouse.wad ? ๐
Huh?
it looks a lot like a doom level known as myhouse.wad
...yes? GAS has nothing to do with character movement
you're asking for a comparison between two completely unrelated systems that solve unrelated problems
yes
the CMC can move your character.
as its name implies
I'm about to implement a CMC custom mode. I want my character to be "wheeled" (specifically on a skateboard) and to be able to wall ride, wall jump, glide on ramp, and dash.
Is it the right choice ? Am I in for a world of pain ?
Only resource I found is this playlist: https://www.youtube.com/watch?v=urkLwpnAjO0&list=PLXJlkahwiwPmeABEhjwIALvxRSZkzoQpk&index=1 Documentation seems to be very lacking about this subject.
Youd have to make your own movement modes most likely
Yeah, i'm afraid that pigging back on walking mode will be janky as hell
The lack of documentation on this subject surprises me though
I can read CMC code though. about 15K loc
source code is always the ultimate doc anyway
never out of date. never lies.
is there a console command to connect a new client? I swear I've seen someone do this
open 'IP'
if you dont need to worry about hackers you can get smooth synch for $20 but if you do and dont wanna be bothered by c++ you need to but the general mover component and its like $600
there a good series
If unable, i'll shell out the 600USD
hm. I want to test a player joining late. Can you connect a new client like this?
https://discord.gg/uQjhcJSsRG
In this video I am introducing a series I will be making which explores the character movement component and how you can extend it in depth.
0:00 Intro
1:00 What is the CMC?
2:00 Do you need a custom CMC?
5:35 What does the CMC provide?
7:10 Outro
I'm kinda new to UE5 and if someone can help I'm having replication issues with my team assignment.
My Player controller runs a on server reliable event to call this function. This function is correctly on server side assigning the player team (replicated) to the player state and works on run. When testing disconnects and reconnects about 20% of the time the server states its setting the correct team but the clients not replicating to the correct team even tho the server is correctly assigning it.
It seems to just disconnect my current client and sent him to the main menu
what is your game mode post-login doing ?
well. I'm usinga test game mode so I can bypass my menus
ill probably switch to gmc if i can scrap money from my project cause smooth synch can look of alot
isn't smooth sync handled by the CMC already ?
no smothsynch is a plugin, which has extrapolation and is client side predicted
Yeah, but isn't CMC doing that, for characters ?
seems useful to have this for non-character actors though, I'm bookmarking this plugin
cmc is very bad for multiple player as by nature it will cause rubber banding because there is a discrepancy between the client server posistion
hu ? I never had any rubberbanding with a Character actor, even with very very bad latency
That's news to me when I shipped a multiplayer game using cmc
(using CMC on a pawn is useless though)
you do need to implement things in a particular way for custom modes to avoid rubberbanding from what I gathered
did you test your game with latency?
I tested it with about 200ms latency
Yes and I said shipped. It's been out for years and ships on multiple platforms with 24 player matches
If you have a pawn with CMC it is expected to rubber band though
what kind of game
CMC and Character class are closely related
FPS
did you modify it in cpp
Yes because you have to if you want to add on top of it
Maybe I'm wrong but "Rubber banding" is just the client being corrected when it's out of sync with the server. The only way to avoid that is to never do any client-side prediction which leads to a shit play experience because everything is going to be delayed until the server approves...
And tons of multiplayer games have shipped using UE's CMC and they are just fine 
Rubber banding is basically a big correction when your many little corrections didn't do the job
Broad statements being made from a place of little experience are my favourite thing
dunning-kruger effect our beloved
I think what I mean is cmc need cpp modifaction to be used in multiplayer
It absolutely does not though
I'd honestly be surprised if sswires and their team, or any team, had to make heavy modifications to make it functional for multiplayer
You only need to modify it if it needs to be more capable than what you get out the box
We had stances and sprinting so we modified it for that
if you want a char that can simply run and jump CMC seems to work out of the box
even on high latencies
not really experienced though
apparently ive been lied to
Well if that's just something from YouTube tutorials then... yeah
the moment I tested with latency cmc brakes down for me
how to you know which tutorials are trash btw ?
You generally don't until you reach a point where you wouldn't need it...
I had the same issue learning MAO. Lots of teachers. Many bad ones.
I observed an inverse relationship between the click baitiness and the quality
If Laura was still here she'd say all of them. But a few things to look out for is if they're sufficiently explaining why they're doing something a certain way
And it's not just a painting by numbers situation
good teachers use the pratical lessons to teach the underlying principle
Avoid anything clickbaity like "I made GTA6 in a week using Blueprints"
Tutorials are meant for people who know next to nothing on the topic. If you know next to nothing on the topic, then you have next to none of the necessary knowledge to make that kind of judgement call other than "How well are they presenting the information" 
But plenty of people can present bullshit excellently
It is, alas, a required skill, in the modern world
but like I dont understand why when I use cmc and try to sprint it ruberband with any latency
Well how did you implement it?
There are a bunch of things you need to override in C++ to actually use CMC's take on prediction
you must use the Character instance
But at the very minimum, the server needs to know the sprint happened
@gray blade if your just increasing max speed you will rubber band, there is 2 simple ways to reduce it, or a proper way which involves flags, etc
also you need to ensure client and server both have the speed at the correct time
else client maybe ahead of server, and server will just snap them back
It'll be nice when Mover is ready for production use in 2035
Mover ?
The successor to CMC but it's early
upcoming replacement for CMC not tied to ACharacter
oh very nice
replacment/successor
epic is replacing cmc
kinda annoying that CMC is so tied to Character
thats why
rule 0 of libraries providers: DO NOT BREAK USERLAND
Mover is kind of a side project that's in the engine because Epic doesn't like its employees having personal projects lol
Someone should tell Epic
lol, must be new to Unreal
dropping cascade stopped a lot of people migrating to UE5 for projects
niagara is great if you have the team and time to convert your cascade stuff to niagara
At work we're likely jumping from 4.27 to 5.3 so that'll be fun. Our effects are like half and half for Niagara and Cascade
The worst part is just PhysX code right there in the game module
finally got my profile system plugin done
does requests to my backend service, and sends back a json of owned items, parses them, and builds up ItemInstances (both a struct representation and a UObject for BP use)
Exactly, and it's really not that hard to figure out once you have the tiniest bit of programming knowledge
My guess here is that you're changing the max walk speed on the client first, then sending an RPC to the server to indicate the speed change. In a 0 latency world this would work absolutely fine.
The problem in this situation is that the CMC sends continuous RPCs of data to the server in regards to where it thinks the client should be based on the movement values it has and there is some latency involved here, and then you're also sending a separate RPC to indicate the speed changed. You don't know exactly when that separate RPC will be received in regards to the movement speed, so then the server can end up seeing that the player requested to be moved too far based on the movement speed value the server has for them, and thus, you get a correction and the character snaps back to where the server thinks the client should be based on the movement speed values it has, until it properly "synchronizes" again and the client and server are moving at the same speed. The fix for this is usually adding a flag that you set with your movement in the CMC's data that it sends to the server so then it can know exactly when the movement speed was increased on the client.
A good test of this would be to press your sprint input, give it a moment, and then start moving - you should have no rubberbanding at all. If you stop, release your sprint input, wait a moment, then start moving and press your sprint input, you'll get a correction, and probably a series of them until you stop moving so it can "synchronize".
It's not like Unreal Engine 4 dropped and we all waited around for 2 months for tutorials to come out
I have vast programming knowledge, but not related at all to UE, or even video games haha
I have been a backend programmer for the last 15 years
You're fine without tutorials, just try to do the thing, and lookup specifics if you get stuck
Issue is often "I can do it this way... but is it the right way"
Also I'll take anything written over a video any day of the week
if you're brand new to Unreal the most important thing is to understand the structure of the engine and the base gameplay classes
like, to have a good intuition where to put code, between game mode, game instance, etc.
Way too much waffle in videos
And I could not find a concice documentation of the lifecycle of these classes
had to find out by trial and error
That can get really tricky, especially in multiplayer
but it's pretty easy to intuit that the pawn is the thing you drive around, the playercontroller is the most direct and private representation of a player, the playerstate is the public representation of a player, the gamestate is the public "abstract" representation of the game itself, the gamemode is the private representation of the game itself, game instance is the representatino of the process, actors are things in the world, components are bundles of state and logic on actors
yeah, but I had trouble finding out what the game instance is used for hehe
It lasts from boot up to shut down
yep
might be useful, might not be, depends
This is where I store stuff that I want toi persist between maps
like when going from lobby to gameplay map
sure, either that or through your save game system, depends on your setup
I hesitated between the two
lots of people use save games as you'll need that anyway to persist between sessions
basically rebooting on every hard map load
Yeah, everything beside game instance is created from scratch when loading a level ?
anyway, I expect that implementing a custom mode for CMC will be challenging hehe
most things you'd have access to for gameplay purposes anyway
yeah custom CMC movement mode is not day 1 material
How is it?
NPP ?
I never touched CMC much, maybe I never have to
network prediction plugin
Pretty sure I answered you that question already
ah !
With SirKais NPP and Mover changes it most likely works just fine. Takes a bit to get used to but should be fine to use.
I used NPP for a prototype at a previous studio. It actually went okay when you get past the bad defaults
Yus
Especially with the work SirKai put into adding the missing smoothing etc
Bit of a boilerplate code hell when adding new systems but well
But the fixed tick policy would be really nice if there was clientside interp like Quake and Source
Yeah well that's what I mean with SirKais changes
btw is copilot useable with unreal code ? or is there too few examples online ?
Oh? Where would I see that?
Pinned
Would you put a whole power network simulation system in NPP?
Basically analog circuit modeling, but simplified. Lots of work on tick.
It's a custom engine repo but the changes are limited to two commits
One to NPP and one to Mover
They don't touch the actual engine fwiw. Only the plugins
I'll take a look, thanks
are you allowed to change engine code btw ?
Hopefully they'll PR it if they haven't already
Yeah that's one of the main benefits of UE
But we all know what happens to PRs
They will try
Yop we have changes on ours too atm
Not the right chan but. It is possible to use Rider debugger ?
as opposed to not using a debugger at all
I tried vs, and it seemed a mess
Could possessing a pawn and then unpossessing and possessing again cause an role change?
And, well, i already use jetbrain stuff every day
Rider has way nicer support by now. Even has Slate formatting
Uff. Why asking?
The fact that it opens directly UE project is really good
There are a lot of hidden gems. E.g. it has context sensitive creation options when right clicking different folders. Source gives you options to add Unreal Classes. While plugin allows you to add plugins via the menu etc.
I got my character to attach to my vehicle for server and client but the second time I get in the vehicle it doesn't attach only works the first time.
who said he's french?
Cedric sounds very french
I never met a Cedric outside of France(I'm french myself)
iirc he is from Germany, but could be wrong haha ๐
I hesitated because the last name is very german haha
German
And Cedric is a Scottish name afaik
So French is a tad off
The last name is somewhat of a hint haha
We might have a lot of Cedric in France due to a belgian comics books: https://en.wikipedia.org/wiki/Cรฉdric_(comics)
kinda famous among my generation (i'm 40 yo)
In all case, thanks you all for the help ๐
No worries
I'm not sure what would cause it to not work after the first time
So it's actually decent with their changes?
thank you very good explanation
i feel so lied to right now
I had multiple people plus youtube tell me cmc was garbage unless you modified it in c++
https://www.youtube.com/watch?v=YB_ew3j_HFw would you guys say this video is total bullshit then?
Wishlist our game Spanky! https://store.steampowered.com/app/1732420/Spanky/
GMC: https://www.unrealengine.com/marketplace/en-US/product/general-movement-component?sessionInvalidated=true
Smooth Sync: https://www.unrealengine.com/marketplace/en-US/product/smooth-sync
In this video we address the topic of multiplayer games made with unreal engi...
You basically have to modify the CMC in C++. The thing I mentioned about adding the flag into the movement data - that's a C++ thing. You can have it do things in blueprints and even expose some of what it does to blueprints, but there is C++ that needs to be done to make those kinds of changes.
And no, I wouldn't say it's BS. He even mentions the problems with modifying the CMC movement through blueprints and that when you introduce latency how it breaks it.
He outlines your solutions:
- that you'd need to learn C++, and this would then allow you to modify the CMC yourself or code your own properly networked movement component
- Smooth Sync - Effectively a client-authoritative solution, so then the client is the one in charge of where they are in the world, and the server tells everyone else, thus it allows clients to potentially cheat. You wouldn't be using the CMC at all in this solution.
- General Movement Component - I don't know lots about it, but it's probably no different than the CMC in that there's likely a lot of code that is locked behind C++, but they may have made it much easier by exposing a lot of the functionality that the CMC does into blueprints. Again, no CMC involved with this solution.
I have been using smooth synch, the game im working on is pve. Should I just stick with it?
I haven't used anything but the CMC myself (but I have made some modifications to it in C++), so my opinion wouldn't weigh very much. If it's working for you, and you understand that players could literally teleport anywhere in the game at any point in time which could introduce game-breaking behaviors and even potentially crash the host, their client, or other clients, then I would say go for it.
"unless you modified it in c++" is doing a lot here, and it is true. I'll even say using C++ is practically a must for multiplayer stuff
To your 3rd point - actually no. GMC is very extensible with BP.
Part of the allure of GMC is that you don't have to muck around in C++
Yeah - GMC is awesome - I'm throughoughly enjoying it - although I'm C++. But BP support is there.
But you still cant get away from if you think you need that level of movement control, then you probably are going to need other things that c++ gives you for multiplayer...
Hello, when I change the map in a peer-to-peer system, should I keep the data of the characters selected by the players and other data to be used within the level in the 'game instance' of the player who is the server? When the level changes, the game mode, game state, player state, and more are recreated.
That or a savegame
Isn't there another way?
I mean maybe persistent actors but you don't want to do that most likely
What's the problem?
You can also just not change the level
or rather, not change the persistent level
I have level 2. One is for the lobby and the other is for the playground. When it says start, I change it to OpenLevel. and I lose information.
Then either save the stuff in a save game, store it in gameinstance, or use level streaming or whatever it's called
thanks, ill try it.
bro coming back with the problem with the doors not rotating, they basically are rotated but not visibly, do you have any advice?
basically what you told me here I already have
this is stupid video for sure just for clicks
What in the fresh hell is this
The fact that he uses cast as an action verb in the first minute makes me nope right out
idk but name of this video boils my blood
the whole thing makes me queasy
like you dont even have anything to support multiplayer in other engines, like in unity you need to use plugins, idk about others
in unreal you literally have working multiplayer from start
not like he could avoid what he wanted to do by doing it in other engine
a topical question perhaps, I have a simple wingsuit mode in the (networked, blueprint) prototype I'm working on, and it requires calling simulate physics on the character collider. That works fine, but using the debugging tools I can see the server & client de-sync badly when I un-simulate physics. I'm new to unreal (but not programming) and the question I ask myself most at the moment is, should I call this method (in this case simulate physics) on the server alone or client as well. I've tried various flavours of disabling the movement mode around this. Any input would be appreciated, thank you.
so you have a character, and you want to move with physics in wingsuit mode, then be nice and synced up when you exit that mode?
Are you synced in wingsuit mode at all to begin with?
yes, the built in debugging tools, and one I've added myself seem to show that in wingsuit mode, simulating physics, I'm synced
heh, I realise this is all going against the CMC, and probably not kosher
I mean what's the path from inputs to something happening physics wise?
inputs from owning client -> server, all changes affected on server
so I'm happy with that simple model for now, the server can be totally authoratative and the client just rep'ing away
my initial uncertainty was around whether to call SimulatePhysics on the server alone, or client as well
but if I call it on the server alone, wingsuitng works fine, but coming out of it creates a ridiculous de-sync - I was expecting that having a "dumb" replicating client it would just do what the server does
You're not getting corrections out the ass while simulating? Did you change the default replicated physics settings?
Anyway, you're obviously landing in a slightly desynced state, either that or you're trying to predict landing
I'd honestly just make a wingsuit movement mode but that's me. I don't like mixing CMC and physics, just choose one or the other.
How do you detect landing?
well this de-sync is visible when I toggle out of wingsuit mid-air, outside of a landing / impact
so it must be around the process of un-simulating physics and restoring character movement
when you say make a wingsuit movement mode, how might I do that? just generally ofc
I'm open to all suggestions
I saw in the movement mode node there's a custom mode, presume this is a user created mode, how do you flesh the state for that out?
I haven't done it but the gist is that the movement mode is where the movement rules are
I do appreciate that my issue lies around character movement being inherently kinematic, just hoping there might be a way of taking the CMC out of band for the wing-suiting
that's where you'd do your gravity and lift and tracing and such
I think it's the prediction that's hanging you up
you're going from predicted movement to not, back to predicted
right, that makes sense
I did try setting the movement mode to None at the start of wing-suiting, then restoring it on end, but that didn't seem to help
I'll do some reading around making a custom movement mode, thank you for your help there.
It'd certainly be more robust, but it is pretty complicated I think
you're basically making WingSuit instead of Walking
Ouch ok. Will have to see if this prototype warrants that sort of effort....
If im making an in game day and night cycle with a time should I program it in the gamemode?
depends
but not exclusively the gamemode, the replicated TimeOfDay would be in GameState
ok thank you
NPP is the important backbone. Mover is not that complicated. It just sits on top of NPP and offers some movement related setup.
It's ultimately just a state machine with some helper functions for moving.
When my Character changes in GameInstance, this(pic) works. And it changes my non-replicated Character variable in PlayerState on the Server.
Client 1: When it switches to Character_1, it works correctly. Client 2: When it switches to Character_2, it works correctly.
Server (client): When it switches to Character_1 or Character_2, all clients receive the character that has been switched to.
What is the issue here?
Because you're doing this directly on begin play, the server is binding this event on every playerstate, so whenver the server decides to change their character, it ends up executing that on all playerstates.
Before binding, GetPlayerController from playerstate (not the one by index) and check if it is a local controller, and if so, then bind it.
May also need an isvalid check on GetPlayerController to ensure there's no errors from clients.
it worked, if u have a moment, could u kindly explain the reasoning behind this situation and perhaps provide a reference?
PlayerStates exist on the server and the clients, so "Begin Play" executes on the server when the server creates it, then it also executes on every client that receives the PlayerState.
For clients, they end up binding their character change event to every playerstate too, but because they don't own every PlayerState, the server RPC gets dropped and only goes through when it's executed on their own PlayerState.
For the server however, as it doesn't have to RPC to itself, it ends up executing the "Run On Server" event anyway as it is the server, and because it's bound on every PlayerState, whenever the host changes the character on their game instance, it'll end up executing the CharacterChange_Event on each playerstate that has begun play
thanks for your interest, attention, and effort, i think i understand now ๐
Hey all, anyone here has experience with UE 5.3.2 and playfab GSDK? Updated from 5.2.1 and now my dedicated server is not deploying on playfab. Stuck on "Pending heartbeat"
Is there a new project setting perhaps with 5.3.2 for networking or a new dll perhaps?
Your best bet might be asking on PlayFab itself.
There shouldn't be any new dlls or settings.
You may want to print the Heartbeat function on your server and then get hands on the logs.
@hollow gate Random question: Do you happen to know if there is a RTT sitting around somewhere that I can get access to inside NPP or any given Simulation?
there should be compressed ping value somewhere. i think player controller. unrelated to NPP tho. are you asking for lag compensation?
Na, I'm doing some hacky custom stuff for systems that aren't using NPP but need to affect NPP.
And I need the RTT for that.
The CompressedPing sits on the PlayerState, that much I know. Was somewhat hoping that NPP is also utilizing RTT/Ping somewhere and has convenient access to it.
no it does not use ping or RTT anywhere.
Not even for independent tick stuff?
I could swear CMC was taking something like that into account to calculate the Timestamps or so.
yeah not even for that. it just uses the sim time that is passed around for time claculations
btw i did PR the changes. you can see the full changes in the ue5-main branch of the repo. has a couple of things i didn't put in 5.4 branch. (physics code clean up and a fix to a bug that made simulated proxies buffered time increase but never go back down.) , i am have my doubt it would get accepted by at least would make them look at the NPP plugin. i have a feeling they are working on implementing smoothing but for mover only not NPP itself.
will update the 5.4 branch next week.
Awesome. fingers crossed
hey, im trying to replicate picking up a gun, on game start the player shouldn't have it, then upon pickup the gun should become visible, held animation started, and be able to shoot, here is part of the code, for some reason when one player picks it up, the other player still gets it and all its functionality,
Can anyone help?
@hollow gate Do you happen to know if one can add a custom TCommonReplicator_AP or similar, by defining it with the custom ModelDef, similar to Services?
Any tips for testing replication?
Can I simulate a player?
Maybe record some behaviour and play it back?
as far as i know, only services can be templated.. and only the tick service itself has the template definition. so by default you can't template the others. i did add the template definition to all services, but that is not in repo yet. will be next week. however those replicators are not services. they are used to bind function to the net serialize of the Network prediction proxies replicated variables ( found in the backend class of mover).
i didn't phrase that right.. the replicators have the functions that are bound to replication proxies variables net serialize to write and read serialized data to and from them.
usually one 1 role writes and 1 role reads.. server would write to simulated entities Proxy variable and simulated entities read from it. except for replay that's a different matter.
Yeah I know how they work and what they do. Would have been cool to customize them for specific sims.
I'm having a bit of an issue with my inventory system, first the equipment slot items aren't replicating properly on pickup (I think the issue lies within the Pickup Actor func call in my pawn class). However I can't figure out a second issue which is that items are duplicating and not properly updating their info when removed from a slot.
im using that uobject replication plugin for bp and it works fine afaik
tho I might rewrite in c++ to simplify idk
Am I correct in saying that COND_OwnerOnly on a RepNotify property in the Character will only replicate to a single character at most? (the locally controlled human client)
As in if you have 30 AI controlled characters and 5 human controlled characters, this property will only replicate down to one locally controlled human character (the one that owns this character), and no one else?
yes
Is it normal for a headless client to take around 20-25% of ryzen 5600x?
Normal client takes around 35% and I expect the headless client to take much less, Do I need to do other things other than adding -nullRHI?
solved the first bit of my issue. Still having issues with items not properly removing from the inventory, this is what Im calling but im not sure what to call on the client tbh
Hi.
Create session in Standalone mode always fails when Steam is open.
Changed game mode, not solved.
Tried with new map, not solved.
No extra settings, just Create session, again not solved.
I changed APPID, not solved.
Removed Steamsocket and tried SteamNetdriver, no solution.
Intermediate etc. deleted, Unreal Engine updated, not solved.
'[OnlineSubsystem]
DefaultPlatformService=Null' (before it was Steam)
When I do, the 1st time it can't create session again, but, the 2nd time it connects. (But others can't join that session, and can't find it)
NOTE: +1k people have tried this game instantly before, no problem before.
How do people usually deal with those "press <key> to pickup" widgets in multiplayer?
Cause making it show up for the right player is easy, my problem is more about what if a player changes the keybind? How do i deal with that?
My idea was to pass the keybind to the widget, as parameter of the function i call to make the widget visible, and from there call a blueprint implementable function to update the text.
Is there a better way?
5.0.3 seamless travel bug is pretty bad like
Is it a dedicated or listen server? Does it work when the game is packaged?
It's Listen server.
It works as a Package, but there was a Play again system I added, and suddenly it stopped working. Then I discovered this problem in Standalone Mode, and I think the two problems have similar origins.
Hello guys, I have a question, what do you recommend to compensate for the lag? I have a small server mounted on an instance in New York and connecting from Latin America I have lag and the setups and systems are not working as they should.
That's like, the hardest part of multiplayer
There are a ton of approaches
Hi Adriel, how are you?
If you have even a little advice about this problem, I'd love to hear it.
well widgets are just local so just do something like get player controller in the widget logic and it will be specific to each player
I want to ask something. I've looked at a lot of sources, and they're storing users' controllers inside the PlayerControllers array created within the Gamemode.
We can retrieve this from the default PlayersArray in GameState.
Is there a reason they do this?
game mode only exists on server, game state is replicated to all clients
Any techniques you can tell me so I'm looking for information?
I might be confused because I'm working on a peer-to-peer system. For the client that acts as the server, do I need to treat the server and client separately? Or is it sufficient to access other users from the game state on this client?
if you are confident that you are on listen server then you can access game mode
if not you won't be able to access game mode
Just Google latency compensation and prediction
It's hard
I don't think UE supports p2p(someone correct me if I'm wrong).
What you're describing is a listen server. In which case there is no separate server/client for the listen server. The client IS the server, and anything you do on that client is server authoritative.
It's not like the player spawns a server in the background, then creates a client to connect to that server. The client is the server.
To answer your question, you can access and modify properties on the game state from the listen server authoritatively
I don't think UE supports p2p(someone correct me if I'm wrong).
It doesn't, no.
You'd have to implement it yourself.
Im talking about the widget component on an actor, is that different from ui widgets?
Starting a server in the background means, to some extent, entering the logic of a DedicatedServer. So, accordingly, i can comfortably use playerstate in listenserver. thank you for your response.
OK thanks friend
A widget component is a scene component that holds a widget
lets you have widget in 3d space
I'd just access the data via the gamestate. It's readily accessible.
Until I get too annoyed of doing GetGameState()->TheThing ๐คฃ
What is the actual data or mechanic?
Oh ok, thanks
You know it is templated right?
GetGameState<MyGameState>()
Nope. Can't
But you can make a function library that does it for you
I don't think a poker game is doing anything at high enough frequency for it to even be measurable lol
If you know the table will not change within a game, it's fine to
Begin play -> get gamestate -> cast -> get table -> save a ref / pointer
then later you can just talk to the table without the chain
It really depends on the frequency of access
ye
just whatever makes the most sense
If you're constantly getting at Table.This and Table.That then just store Table.
If all you care about is Table.That then store it
When passing in previous values to OnRep funcs on a listen server, the client will automatically pass the prev value in when the OnRep function calls and the host must manually pass the prev value in when calling it, correct?
(I know best practice is to have the OnRep call another func and only the host call this func but same difference in this case)
This message usually indicates that the actor isn't owned by the client that is making the RPC call. Are you sure you're assigning ownership correctly and to the correct player?
What is that Player variable set to?
Like how does it get its value?
Ok, no need to get the controller from the playerstate to the pawn as the playerstate actually has a "Get Pawn" function you can utilize.
Try verifying what the "Player" variable actually contains, like print the display name of the object before spawning the actor.
Again, are you sure the owner is the correct pawn? How do you choose which playerstate you're using to determine the pawn to use?
How do you choose which playerstate is my question. Like what triggers this sequence where the playerstate is retrieved.
And yes, owner is normally replicated and setting the ownership on the server should be sufficient.
What starts this process? Which event?
If it's being spawned, and you're spawning it on GameMode then it's running on the server for sure.
Yes, it should be the same on both
caveat: the display name may not be the same on both.
But the reference would be to the same object.
The event i'm using actually fires on both server and client, but with the has authority it's ensuring that the server is executing the spawning of the actor.
It shouldn't matter.
The only other issue could be order of operations.
If you for sure have a replicated actor, and are setting its owner to an actor owned in some way by a client (like their playerstate, controlled pawn, or player controller) then the client should be able to send RPCs on that actor.
It doesn't matter what blueprint spawns that actor, other than it is spawned on the server.
Hi, so if I put as listen server p2p connection. Is the host player considered the server in game play?
There is no p2p in unreal's networking system, only client->server, and yes, the host is the server.
I assumed the listen server was the p2p ๐ฎ
P2P = all clients are responsible for handling the state of the game.
there is no central authority.
Ah
So when I make a game and there is like a server to multicast custom event only the host can run that right
P2P means you can have a bunch of players in the game, and any one of them can quit and the game can continue.
Client->Server means you can have a bunch of players in the game, and if the server quits, everyone else loses connection.
Ohhh oh yeahh
That make sense thank you!
Is there differences when you possess a pawn that is owned by an ai controller vs one with no owner?
Damn, characterMovement seems very fun to override. Lot of liberty to mess around in here
Does not possess kick out other controllers from the pawn ?
can multiple player possess the same pawn ? ๐ค
man I have the weridest bug
somehow a replicated bp variable on a server spawned actor is not being registered as replicated
it just behaves like an unreplicated variable
Are you setting it off a server rpc
yea
and then additionally it works the other way around too where if I do set it on the client, it keeps that value on the client (should not be happening of course)
yeah i'm completely lost. spawns from the game mode, actor is set to replicating and always relevant
yeah but even then, why would the server not be able to change its value?
If I am running something like procedural recoil on my character, would it be better to have the proxies just play a animation of the recoil versus replicating the procedural?
Have you accidentally set its Replication Condition to something like Initial Only?
Generally speaking Simulated Proxies would only ever perform a "firing" animation that would appear as though it has recoil.
Ok thats what I was thinking, thank you!
I don't think so, it's just set at 'None'
How do you know its not replicating?
I test with PIE, spawn 2 players, one listen server host and one client, change the value of the variable on the server, put a debug breakpoint to check that it was changed (it is), put a breakpoint for where the client tries to access variable, don't see the change
C++ or BP?
I also tried with the object just pre-existing in the level instead of spawning it, still no luck
it's BP
Show your BPs
it's an array of BP structs if that helps
I actually setup this quick test to make it easier for you
variable is still false on client
Restart the editor?
I did a few times, it still didn't fix anything
Show the Replication settings
And the Actor itself?
it really does feel like GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) is not being called
Then why would you post C++ code
Is this Actor based on a C++ class you have created?
Dont explain it like that
Its just confusing.
So this isnt a C++ project at all?
the project is C++, but the actor in question here is not
Are you using Hot Reload?
no
Well Im not sure why its not working then.
Seems like you have everything basic setup correctly.
yea that's why I'm losing my mind
I have plenty of other things in this project that are replicating just fine too
but thank you for at least trying help, I really apreciate it
ok now i'm even more confused
just made a duplicate of the blueprint, the duplicate is working fine
maybe the original is somehow corrupted?
That is entirely possible.
Hey guys, what's the best way to enable adaptive net update frequency? Would something like this work? This successfully changes it inside the editor, but I'm not sure if it will stay enabled when the game is packaged.
const auto UseAdaptiveNetUpdateFrequency = IConsoleManager::Get().FindConsoleVariable(TEXT("net.UseAdaptiveNetUpdateFrequency")); UseAdaptiveNetUpdateFrequency->Set(1);
logically, i cannot create an Event in the UI Widget and say Run on Server, is that correct? (n listenserver mode)
Replication and RPCs in Widgets do nothing.
They are local only, so there is no where for them to send network information anyway.
same question, according to my tests, I think I cannot do it in "run on server" in gameinstance.
GameInstance is also a class that is not Replicated...
You need to read the Network Compendium
It is in the Pinned messages on this channel.
the issue was that, farther down in the execution graph, somebody else's code actually was hogging up the network because they were a replicating some huge variable, and that is what was causing my code to fail
the rare case where something can fail even when setup correctly
it was a mistake on their behalf, they shouldn't have replicated the way they did, but the're still learning, so can't say too much
and a good reminder to always check the logs, because there were warnings in there about too much network data
Guys, I'm going to start studying dedicated servers on the unreal engine, what shouldn't I run on a dedicated server besides visual things?
If anyone has any material on this subject that they can share, I welcome it!
You will find out pretty quick, like visual things wont even run even if you wanted them too. It will depend alot on your game, but the server should be the one enforcing the rules as it were. What that means for your game can vary
For example if you have an inventory, the server should keep track of the inventory and just replicate what its contents are to the player
I understand! Thanks for the insight.
of course ๐
I noticed that when I run it in Client Only, some things in C++ fail, i noticed that when I run it in Client Only, some things in C++ fail, in this case just use a
if (GetNetNode() != NM_DedicatedServer)
{
}
Am I right?
Not sure what you are referring too. But generally, you shouldnt need stuff like that
For example, I have this code here in the weapon class of my project working normally on a listening server, but when I test it in dedicated server test mode (Client only in editor) it throws an exception in the code and does not present any value in the debug so I can check and test
FVector AFNRFireWeapon::PredictDispersion() const
{
const FTransform CameraTransform = IFNRWeaponComponentInterface::Execute_GetCameraTransform(CharacterOwner);
return (CameraTransform.GetRotation().GetRightVector() * (FMath::RandBool() ? WeaponData.MovingSpread : -WeaponData.MovingSpread) +
CameraTransform.GetRotation().GetUpVector() * (FMath::RandBool() ? WeaponData.MovingSpread : -WeaponData.MovingSpread) + CharacterOwner->GetVelocity()) *
-IFNRWeaponComponentInterface::Execute_GetSpreadMultiplier(CharacterOwner);
}
That is kinda what I mean about you will find out pretty quick
Listen serves and dedicated servers are different. A listen server is also a client, so UI stuff will still work on it since the host is both server and client
A dedicated server is just that, a dedicated server with no client stuff on it. So in your example, while Iโm not sure without seeing the error. Iโd wager itโs your camera stuff
I'm using ALS Refactored, I think it's kind of difficult for the camera to be the problem...
You would be surprised
But as I said just a guess without seeing what specifically isnโt working
Sorry, I forgot to mention it, this error only occurs if I drop the weapon, I think the problem could be between the screen and the chair (me), hahaha
Isnโt it always ๐ and I donโt mean to say that in a rude way. As the saying goes a computer will always do what you tell it to do XD ๐
exactly! lol
Ok, the problem really was between the screen and the chair, hahaha ๐
Hey guys I'm having an issue where I'm using repnotify to trigger an event and it works fine for the host but on the client side it is firing the event twice. I have this set up in a weapon blueprint component. Anyone have any idea what it could be?
(Its not an issue with the OnRep function as the print string is appering twice for client)
If you're seeing the "Hello" twice, then that's an indication that your input action is likely set up to trigger twice.
Or you perhaps have two weapon components attached and both are being triggered.
I have the blueprint components attached from begin on the character blueprints. I just don't understand why only the client is firing twice while the host is working as intended.
Show what your begin play looks like.
I dont know why but I just added the code directly to the char BP instead of using the BPC and now it works so it must have been attaching it twice for the client for some reason
This is what it was before for the char BP
Begin Play fires on both the client and the server.
So when your server character spawns, it'll fire on the server adding that component. When a client receives that replicated character, it too will add that component, but it doesn't effect the server at all since it's a client.
When your client's character is spawned, it'll fire on the server, adding that component which replicates to the client. When the client receives that replicated cahracter, it too will add that component. This time, the owning client will end up having 2 components that it is in control of, and both will respond to the input event.
Oh okay should I use a Is Locally controlled branch for begin play events to avoid duplications if I wanna still use begin play? Also yeah I just added the BPC as a component of the character on the left tab instead of begin play and it worked thank you
Holy shit I just did that and it fixed all the bugs I was having with this thank you so much @sinful tree
the biggest thing I'm struggling with at the moment in my (blueprint, prototype) project is knowing what common built-in methods are automatically replicated by the engine.
For eg. on a replicating actor, is AttachActorToActor replicated out to the clients automatically for me?
How about setting SimulatePhysics on the character capsule collider?
Is there a heuristic or documentation for that?
Once again, I'm just trying to figure out how to implement certain aspects of replication. the entire game is what you see (enter a name, join a session, have your name displayed on the player list). I would like to Player List to show the chosen username that the player typed. Someone please help me end my struggle.
I think instead of getting all playerstates you just get their own playerstate and get the variables there
Need to have some way for the widget to know when the name changes to update itself
And using the built in playername in the PlayerState won't work in Blueprints as you don't really have a way to set the name.
So player types name in widget > RPC to server in some player owned actor > server sets onrep replicated string variable in playerstate
On Rep Fires > Broadcast an Event Dispatcher "OnPlayerNameChanged"
Widgets that need to care about a playerstate need a reference to the playerstate they are paying attention to. On Construct > Bind to OnPlayerNameChanged of the PlayerState it is paying attention to > Read PlayerState for New Name > Update Text Field
@devout sonnet ^
would the PlayerState be a Player owned actor?
it sounds like you are right on the money, because I found that nothing I type in that box is getting saved. all casts fail.
Yep
So player types name in widget (W_CreateSession) > in the PlayerState create a custom event and set replicates to Run on Server > (in PS) create a string variable and set it's replication to RepNotifiy > (in PS) in the function that was created (onRep...) create an event dispatcher and call it in the function?
Back in W_CreateSession, get Event Constuct Node > get the playerState and cast to MyPlayerState > Bind event to OnPlayerNameChanged > bind the customEvent
and do what?
Read the PlayerState it cares about for the new name > Update your text field
@sinful tree I definitely missed something in the PlayerState but this is what I did
Your widget needs a reference to the playerstate that you care about.
That's the one you would bind to.
and read from.
which widget?
Your widget also needs to do a "SetText" to the actual text field, unless you're using a bind, but you shouldn't if you've already gotten this far with an event dispatcher.
This one here.
This is the one that needs to know about the specific playerstate it seems like.
And don't bother with index or IDs for players. It just makes it hard to manage. The PlayerState itself is the reference to the player.
can I just create a PlayerState variable set to expose on spawn?
Yes you can
thats the downside to following tutorials i guess.
so i passed in a ref of the playerstate
And now that widget needs to bind to that PlayerState's event dispatcher so it can update itself.
To kick, you can pass a reference to the playerstate along rather than using the IDs.
To ensure that the kick only appears for players that aren't the host, you check if the the playerstate's player controller is local controller, and if so, that's your host.
Instead of "GetPlayerState" in this image, you'd connect up your PlayerState variable you've passed into the widget.
@sinful tree this is what i got so far
This part should really be "Get Owning Player -> Get PlayerState" rather than Get PlayerState 0.
This part here, you need to make sure your bound event also does a SetText to upate the name in the text widget.
This part here, you don't really need to cast outside to get the name as you have the playerstate reference within the widget itself. you also don't need the ID # or the name as variables, just read directly from the playerstate.
Don't need to have "Username" as a variable in the widget.
You also need to ensure that you set the text OnConstruct too, not just on your bound event.
I have it set further up, i'll go back and fix the whole playerID thing once i get this figured out.
Nope... need to read it from the playerstate.... Should be hooked up like this.
Err
oh
You need to set up that bind before your server check.
like that?
Yes, but you still need to set the name in the text field during the OnConstruct event, just read it from the playerstate.
Copy this part up to where it's pointing.
@sinful tree Now i just get the default value I put in the playerState
AI stuff is server only.
Put some breakpoints in, see where it is failing. When you update your name it should update it in the list.
Ill have to look up how to use breakpoints
This cast fails
Are you set up to use PS_Lobby on your game mode?
yeah but I'm probably doing something wrong. I have the CreateSession widget in the MainMenu Level, and then the PlayerList in the Lobby Level
Everything is normally lost when you move between levels without some additional set up done in C++.
damn
Main menu you wouldn't normally be networked.
You can store what you want set in the GameInstance, and then have the player RPC it in the begin play of their player controller in the lobby, but just make sure you're check if it's a local controller before sending the RPC.
this cast fails too
Did you set up your project settings to use BP_GameInstance as your game instance?
probably not..
damn it i forgot that i had to do that.
Hi guys im having an issue related to replicate movement in the client, i need one character to grab another but i dont know why the client character does not replicate the movement when its grabbing the server. i have replicated collisions and i have deactivated movementcomponent but its still not working. Heres the video, i can enter a voice channel if u want, thx for help.
it seems that the collisions are not replicated, but i setted them to do so.
if i dont i cant grab another character, it lags
Yeah and seems to lag worse without it
There's no client prediction
nope, look i will activate them and i send video
it may be that, how do i activate it?
That's what cmc does
this is the same with cmc activates
i think so, im deactivating collisions on serverside and ive replicated the component on editor
I think you'd have to do a repnotify to do it on all clients
Or repusing since you're in c++
it dosent work if i set true the replication on the capsule component in the editor
??
Not in my experience
hmmmm its dificult to do onRepNotify? im new in that terrain
I think that just replicates properties of the component
Not really
I don't do c++ so I can't really help you there
how can i do it no bp?
I know it's called replicateusing and then you declare the function It calls
You set a variable to repnotify and it will automatically create a onrep function. Whenever the value of the variable is changed on the server that function will fire for server and clients
ok i will try thx
Replicating a component doesn't mean squat unless the properties are also replicated
that is the properties within the component
i dont understand srry ๐
what part of that is complicated?
replicating a component doesn't mean "make every property of this component replicated"
the properties within the component have to be marked as replicated to be replicated
yh, they are marked here
yeah please read the words I'm writing
hmmm srry im not eng so im trying to understand
it doesn't matter if the component is replicating if the properties related to collision aren't
you don't
make your own property
in your actor
and use that to set it on the client
okay... ill try hehe thx
how can I disable tick on possessed for not locally controlled pawns
basically this but i want to do it on possessed
On Possesed run on server machine
So you will only change the tick behavior of the server's version
in cpp, you can use OnAcknowledgePossession
that one runs on Client
yes I know currently trying this
I also tried doing it if role was not autonomous proxy but didnt work
I am not doing c++
Make a function that sets the tick to true/false in your character (Client RPC)
OnPossess -> Get Pawn -> cast to your character -> Run the client RPC
ah thats what I tried before this but didnt work either
get pawn as object for cast?
try again and show your codes for others to inspect. If you want to use OnPosses, you need to do client RPC to actually tell the client machine to do stuff.
The pawn is passed thru OnPosses function
I'm gonna sleep, gl.
yeah I tried that but I probably did the cast wrong. I used get controlled pawn from the controller ref
thats on the controller
but I understand what you're saying I should be able to figure it out
I may have mistyped I mean't I'm doing this on Event Possessed in the character. Sorry for confusion
So I have been trying to fix this all week and am really hoping someone knows what might be going wrong here. I'm trying to rearrange some Pawns on opposing teams. The AI controlled ones face the correct direction, but the player controlled ones seem to have their control rotation reset. I've looked in the entire project and there is no where that should be setting the control rotation after it's being set after the rearrangement.
I think if at all the Viewport player
Not sure if there is a hotkey to do it in other windows
try shift f1
Do stably named references use FNetworkGuid when replicated or the full asset path string?
Assuming there isnt any other code manipulating the data, it could be from using it in the construction script. Maybe class defaults are applied after construction. Which variable is it causing the problem?
Hello, I'm looking for someone who can answer several questions relate to Unreal Engine Replication system. I'm working on my small project on my free time and i feel like my current replication solutions are far away from perfect, lack of knowledge on this topic is killing me =/. So if someone have experience in that topic i would highly appreciate to have a small ~30 min call to present what my concerns are ( as it will be easier to show on project directly ). Thanks in advance!
I am working on a customization system that should be replicated in the menu as well. Reason is, In the menu there can be other players as well, ie. the party or the friends who joined. It is built for a dedicated server setup but it's not working unless the player is the server which means the replication is not working correctly. Right now the player customizing their own character and all others can't see the changes. As a listen server the player customizing can at least see their own changes. Here is a description of what I am doing:
Right now I have it that when I press a button of a customization item in the menu, ie. I select it, it calls from the menu widget blueprint a function called "Update Appearance" in the character blueprint and inputs the name of the Data Table and the ID of the item selected in the function call. Then this function inside the character blueprint gives these two values and calls a Run on Server event in the character blueprint called "SR_UpdateAppearance" (Image here, breakpoint has not been called when playing as client and print string not been printed). This event then takes the values that were input into the call and stores them in a replicated name variable for the Data Table called "AppearanceDT" and a string repNotify variable called "AppearanceID". Inside the "OnRep_AppearanceID" function it gets the value of "AppearanceDT" and uses a Switch on Name with the different Data Table possibilites to get the correct Data Table and call the correct Get Data Table Row node. Then it gets "AppearanceID" and uses it for the Row Name . The outputs are used to update the skeletal mesh components.
Oh I found the problem. Unpossessed pawns can't run Run on Server RPCs
In my GameMode, within the postLogin function, I get the x actors in the scene and loop through them. I change the y object reference variable of the x:1 actor.
When a another client joins the game 5 seconds later and performs the same action, the y object reference variable in the x:1 actor appears empty. ??
Show your Blueprint
Is the Actor set to be Replicated?
Is the Object reference property marked as Replicated?
yes all f replicated, this s my x actor, set variable event, triggered by gm
gm
Why are you spawning pawns like that?
Why arent you just using the DefaultPawnClass setting?
On the GameMode?
These are static characters, they will not be played
if I make changes to an actor that I accessed through the GameMode, those changes will be made on the server, right?
Unless the player joins after the change event happened; which looks like may be happening based on your description.
When I hit jams like this, I usually move to rep notify. Wish I understood them better.
thank you, I will try writing it differently from the beginning.
The game mode only exists on the server
Is there a way to detect in a blueprint if the build is packaged server? I have a GameInstance that inits an SDK, but I only want it to ever run if it's packaged and is a server.
This should do the trick I think.
'Is Packaged For Distribution' only works for client build as far as I could find. Not for server.
correct
server is going to be built as 'development'
perhaps theres a 'packaged for development' node
LE Extended Standard Library plugin supposedly has a 'With Editor' node I'm going to try.
in hindsight, why would u ever need a bp like that
if its the server u already know its the server...
its redunant
Need it because I have an Amazon server build that creates a server object and inits an SDK. It crashes the editor, debugging the C++ isn't worth it. The SDK and server object are completely unnecessary in the editor.
I can just disconnect the nodes and stop the process then reconnect when packaging the server but it's a wrinkle in the pipeline that would ideally not be present. I've forgotten a few times and it's just getting annoying. Trying the LE Extended Library.
Here we go, hopefullly this works. Works in the editor, it doesn't crash anymore now just need to upload and test in AWS.
Hey, i have a bit of an issue and am wondering if anyone can help,
As you may be able to see, when the client fires a lava bullet, on the other client its shown as a regular bullet. I may be hard to see but of the client firing the bullet, a regular bullet is fired along with the lava one,
Any ideas on what i could do/how it could be fixed?
Gonna need more information than that. Show us how you're firing the bullets and assigning the red lava bullet.
The lava bullet assignment isn't being replicated correctly (it's red in the owning client and grey in the other) and the fire event isn't being replicated correctly the owner is receiving a message from the server and it's also firing it's own bullet so you're repeating the same event on the owning client. You have two separate issues.
Ok thanks a lot, shall send more information shortly ๐๐ป
Best way to setup a default location for the player camera when joining a multiplayer map, before they get assigned a pawn? ๐ค
Hey, guys! Need some advice. Faced with such a problem - when a player gets on the server map is loaded in parts, it turns out that you get almost on an empty map and after some time all the assets on it is loaded. This does not happen for a long time, but still annoying. Maybe someone knows any options as you can first load the entire map and then already let the player there? I would appreciate any advice
Hi,
How do you structure actors in a multiplayer game when you want to use an instanced mesh?
Right now I have hundreds of actors of the same type each with a static mesh. Different sizes and materials.
I understand I can switch to using an instanced mesh. I could make all the actors refer to that mesh.
But it occurs to me that I could also just use a single manager actor containing the instanced mesh and an array of per-actor data.
I assume that replicates efficiently? In which case it would generally be a desired optimization?
hi, quick question, are functions replicating by default?
functions on the player character
no, read about RPC in the pins.
ok
Trying to get Steam session to join invitation, does someone know how I could fix this :
LogOnlineSession: Warning: STEAM: Failed to respond IP: XX.XXX.XXX.XXX
AdvancedFriendsInterfaceLog: Warning: UAdvancedFriendsInstance Return a bad search result in OnSessionInviteAccepted!
i made the function as a custom event, but it does the opposite somehow
i'll capture it and show you
this is the code, and i'll capture gameplay
you are only calling the function locally. This aiming stuff can probably be done with a RepNotify function.
The general rule is to read the compedium 4 times, practice and another 6 times if you still don't get it.
You probably should try to sync a variable first, if you can't do that, then you are already jumping too far ahead.
unsuccesfull then ๐
@grizzled plank btw summoning and removing the crosshair shouldn't involve networking imo
imo too
that's why i asked if functions replicate by default
i figured it out i think
if its in a custom event which runs on server, does that mean that the following custom events also run on the server even if the custom event does not replicate?
and if so, how do i call the non replicated function when i holster the weapon?
is is possible to write custom replication system over UE to support ECS to not use Actor ?
something like MassReplication ? I Found DeltaSerialize till now but dont know much
Run on server just means run the event in the server instance (eg if you are the listen server then the code will only run in your computer)
Basic multiplayer is like knowing what runs on server, what runs on client. What to sync, what the client sees/have access to, etc.
even Mass goes via an actor
do you have a video recommendation about exactly that?
Exi compendium and wizard multiplayer tips and trick are your best source to learn the mp basic. Both pinned in this channel.
Don't waste your time learning from youtube for multiplayer is my 2 cent
ty so much !
@chrome bay yey im seeing its code right now its more like a mess not mass
isn't there any other way to replicate directly by having channel , custom net driver, ...
not AFAIK, the entire replication system is pretty centralised around actors
i wonder if its possible to implement priority or rate control through one DeltaSerialized property ?
what if we serialize large data ? i guess the actor tries to send it in smaller chunks ๐ค
priority and rate control is all done at actor level
really good documentation, tyvm ๐
thank them ๐
Hi, I'm working on my first multiplayer project, basically it's a "dodging game" the players are positioned on a board and giant objects are sent to the board if a player gets hit they die. The problem comes from the synchronization between the server and the clients, because the objects have physics and bounce, the problem is that the bounces are not identical and the clients die without even seeing what is killing them do you know how can i fix or trick it ?
I'm actually only using blueprint
Blueprint only for multiplayer is very limited. Also imo you are touching territory that even seasoned dev struggle with. Networked physich is always a challenge from what I've read
@dark parcel Oh thanks for your quick reply, i'll probably go for fake physich system then
i got a box, on client 1 the collision is disabled, on the other clients, it enabled and blocking them.
the issue is that when the client 1 goes inside, for the other clients it will render weird stuff for the client 1 (like if if was blocking him)
any ideas on how to fix this ?
Why do you have clients running different things? The server should be the authority over collision which all the clients use.
I need to have areas blocked to specific clients
are you sure about that?
yes
perhaps instead of client specific collision it can be character specific or channel specific
so that way both clients and the server have the same simluation of events
one player might have a character which can overlap certain actors and another player's character can't but they just happen to appear the same so to the player it looks like one of them is passing through the box but their character can not
that way you have the same end result without a difference in the overall simulation
i cant do with channels because i am limited to 16 possibilities.
for the character specific, what do you mean by that ?
it doesnt even have to be a different character it can just be a temporary collision change but it should be replciated so that other players have the same state
basically what im saying is you want the state to be replicated to all clients so that the simulation is consistent but you also want to maintain a difference between what certain players can and can't do
could you describe the context a bit more to help me understand?
as said above i cant use custom channels.
and since one client is the listen server, i have to change collisions on the specific client, not the server
Here's an example. Say there are two player controlled characters in a prison cell and one of them has an ability to walk through the cell bars. You would first activate the ability via key press on client side, then RPC a change in collision behavior so that the server receives the change and replicates it out to other connected clients. Then when the character walks through the cell bars it doesn't appear to get blocked from another client's view.
The cell bars might be a world dynamic while the rest of the prison cell walls are world static. While this ability is active the character can overlap world dynamic actors. Meanwhile the other character in the same cell doesn't change but still receives the update in state so that everything appears to be correct.
using channels would be a good solution if i only had a few situations.
but in my game there is a ton of situations AND scenarios, so using channels is not possible
You don't need a unique channel for each situation
You have a change in state for each situation
if i have 50 boxes
i want client 1 to access box 25.
how would you do that ?
and ?
how would you block the collision using that
They'd all be part of the same bp_box with a public variable int called ID