#multiplayer
1 messages · Page 240 of 1
If you haven't setup your OSS (like Steam as you mentioned) then it'll use Null OSS (by default), which will only support lan connections
where I need put steam_appid.txt in packaged game
As Layso says, you can't use sessions with the null subsystem because there is no online backend system to support it. Your only option with the null subsystem is to connect via IP address directly or use LAN
If you want actual session management, you will need to use some online service backend to provide for it
Anyone who uses CMC should probably upvote this so Epic prioritize the fix:
https://issues.unrealengine.com/issue/UE-202206
Anyone who uses CMC
Soooooo like everyone
@upbeat basin I tried what u said but still same result
. Btw I tried with character movement too but result is worst.
This problem is still continouning. anybody can help me about listen servers
Yo, there are some poor souls out there using Mover.
mover feels so attractive to me since I'm making a game where you can control many different things
but it sounds kinda awful still
Don't touch it.
I ain't touchin' it until Fortnite has had at least one full season on it.
Yes so go upvote it, it only has 16 😐
I'm still at work foo. I'll upvote it after work 😅
Your priorities are whack
I agree. SIlly me for wanting to eat.
Exactly
Downvoted. You're welcome!
Fighting the good fight
hello guys! im trying to change a variable from a widget so it prepares a player for the next round, but on the check, it still treats each client as their individual worlds without changing the variable for each character, so both players are never "ready" . I have tried a bunch of stuff like rpcs, trying the changes in the gameState/gameMode, the variable for the players are replicated, but nothing seems to get the job done
this is the first general code inside the widget
this is the code that readys the players, inside the gameState
and this is the loop to check if everybody is ready, also inside the game state
what i am missing/doing wrong?
Honestly lol it got shared around so much -- and for the amount of sharing that went on, very very few votes!!
You should be using the PlayerState for this as well.
Since each Player has to declare they are "Ready", this should be a variable on their PlayerState.
The GameState would then just check all PlayerStates for their "Ready" state.
i actually had one of those variables on the playerstate too, i cant recall why it did not work properly last time
if i just change the variable from the players to the player state it should work?
i see
Another thing I just noticed is your ReadyPlayer function is a Multicast RPC
But its being called by Clients
Multicast RPCs can only be correctly called by the Server.
You likely want to change it to a Client RPC instead.
This means that the Client that clicks the Ready Button, will send an RPC to the Server, to tell the Server that they are Ready and the Ready variable on the PlayerState should be set to true
That Ready variable should be set to Replicate as well. So other Clients know that Client is Ready.
the being called by clients, its because of the CastTo? or because of the game state
and, dumb doubt, whats the difference between a client rpc call... and just having the function not being rpc at all?
I think you need to do a bit of research on some of the basic concepts for networked multiplayer.
Read the Network Compendium that is pinned in this Channel.
i actually have that pin on my favorites
So go and read it, a couple of times.
Especially the parts on Replicated Variables and RPCs
i actually get a lot of stuff, but i have the feeling that on places is not consistant, and i do get lost sometimes wihtout specifics
yeaal ill give it another read
also i will try the fix you told me and see if it does the trick
In fact, one of my fears is that the widgets were treated diffrently on multiplayer
Widgets don't know or care about multiplayer
how unconsiderate from their part
Your systems should work with or without UI, UI is just the interface to and display of some other system
that actually makes sense
Say a player wanted to say they are "ready".
Widget checkbox event -> Run on Server RPC in PlayerController or PlayerState -> PlayerState.bIsReady changes -> repnotify
Something like that.
You could easily have a hotkey that just jumps straight to the Run on Server RPC, the functionality exists fully independent of the UI
this is the way
it does make sense, but im always afraid that the reason im stuck somewhere is because some specific that only happens on one instance
but yeah, this was not the case, i can see that now
i would say there arent too many gotchas in general. you are probably just learning and not realizing that you are passing over issues you struggled with before 🙂
as matt said, i should re read the compendium, but i like to learn doing directly the stuff in the engine and seeing it work live
By default, design your systems like:
Client to Server information transfer -> Run on Server Event in Pawn/PlayerController/PlayerState
Stateful Server to Clients information transfer -> replicated variables, with RepNotify if you wanna DoStuff™️ when they change
Transient Server to Clients information transfer -> Multicast RPCs
that sumarises it up pretty good actually
im gonna screen shot this
and thanks for the help and patience guys
Well they target a fix for 5.6 already so not sure votes would do anything at this point.
Hmm to me that means 'gosh we hope we can have it by then' rather than 'we have a team on it' 😄
Maybe, but I also can't say the votes have done much in the past.
Well it can't hurt I guess
From a group that was called to vote 
Related to a different issue but
Alright.
not sure what I'm doing wrong here but my OnRep isn't firing:
UFUNCTION()
void UpdateIron(int32 Amount);
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, ReplicatedUsing = OnRep_Iron, Category = "Data")
int32 Iron;
void URInventoryComponent::UpdateIron(int32 Amount)
{
Iron += Amount;
}
The variable is also in the GetLifetimeReplicatedProps
And both the component and the owning actor (the character) is set to replicate - what am I missing?
I m sharing it twice sorry but anyone know well about listen servers can help me?
Hi, relevancy related question:
I have my level, I've pre-placed loot spawners on this level.
Loot Spawner is a replicated AActor with these replication parameters(see the screenshot).
I've noticed that when I`m leaving NetCullDistance with NetLoadOnClient set to true my Loot Spawner is not destroyed.
Does it mean that all pre-placed loot spawners with NetLoadOnClient = true behave like AlwaysRelevant?
for some reason i cannot jump anymore on my client (prediction gets canceled by server)
after debugging, when jumping, ACharacter::JumpIsAllowedInternal returns true on client, and false on server.
it returns false because JumpCurrentCount is set to 1
this is called on listen server BEFORE bJumpIsAllowed = JumpCurrentCount < JumpMaxCount;, which will return false
well nvm the issue was linked to how my code reacts to jump, basicly i was setting movement mode to falling before doing the jump
you are calling this from the server, right?
yeah, I just figured it out, from a listen server I needed to call on rep manually, I thought server and client would run in a separate process
dedicated server it works as expected (connect as client)
in c++, an "OnRep" only gets called on the client
different from bp where it gets called on both client and server
thanks @exotic wasp
This can cause it too
https://issues.unrealengine.com/issue/UE-202206
its not the same issue
but yeah i saw it
I find it strange that they didn't sync JumpCount through the replicated state tbh.
Hopefully it was just an oversight
Hi! I need help creating a blueprint that checks when the amount of players that are specifically Hunters, are all dead it plays my game over. So i basically just need help getting if all players of hunter class are dead
Easy peasy. Have the Hunters register to the gamestate. Or a component on the gamestate. This just puts them in an array. When they die, have them unregister. Inside of the unregisteration process (on the gamestate or component if you want a component approach), check if the array is empty after removing. If so, all hunters have died.
- Array of BP_Character_Hunter in GameState or GameMode
- BP_Character_Hunter BeginPlay -> GetGameState/GameMode -> Get Array -> Add Self
- BP_Character_Hunter EndPlay -> GetGameState/GameMode -> Get Array -> Remove Self -> Check if Array Empty -> Game Over
Potentially limit to SwitchHasAuthority in some areas, specially if you choose the GameMode for storing the Array.
And yes, Duro said the same thing, but I was already typing and didn't want to delete it all.
Of course, if it is possible to eliminate all spawned hunters before you have a chance to spawn more dynamic ones, you have to account for that situation as well.
does anyone here have experience with steam advanced sessions if so i got a question for you
I do the same stuff. "Ahhh - I've already committed, here ya' go"
Truth is I saw you typing and wanted to beat you.
so the current thing i have done is that when they die they become a spectator under the spectator class. Which works perfectly. is it possible to plug that ^ in around that or would i need it somewhere else
#online-subsystems might be better
thank you
does anyone know any ways for ue5 multiplayer to work without ue5 source
Your Spectator stuff shouldn't have anything to do with this.
the spectator stuff is handled under the level blueprint is that cool as well?
You only need UE5 Source to build the DedicatedServer. If you don't need one and your Players can act as Servers then you wouldn't need the Source Build.
What do you mean? Like, a source build? Because if so - yeah, works fine.
what if i want a basic host and join button would that require dedicates servers
Using the Level Blueprint for Gameplay code is as cool as Anakin betraying the Jedi.
so...its cool cuz the jedi were corrupt anyway ? 😅
Actually, you could be a sith fan, then this doesn't work.
No
do you have a video i could follow
No
i cant find any videos for that and if i found one it dosnt work
okedoke
You can't find a video on joining a MP game? Or what specifically?
no like on how to make a mp game with host and join ive found many but when i go to test my game work outside of my house and with another friend it never works
i moved it into GM instead
How are you trying? Just doing it raw?
Because if so, you need to do some port forwarding
oh ok
DedicatedServers are headless processes that aren't themselves players.
They are usually used for games where players want to join the server, do some stuff and leave again. Like Survival Games for example.
They are also used for Competitive games, like Fortnite, Counter Strike, Overwatch, but there is usually a bigger backend in place to automatically spin these up etc., which is a lot more involved and has high hosting costs.
ListenServers are players that are acting as Servers. This allows them to cheat but you wouldn't need the Source Build and you wouldn't hae hosting costs.
That's just how networking works.
Otherwise you need some kind of relay server - which is where stuff like Steam or EOS come in.
@thin stratus do you have like 5 mins to jump in a call and explain how i do what you said earlier by chance?
They don't.
Absolutely not, sorry.
dosnt that require stuff in my internet
Your router
gotcha just checkin 🙂 ill figure it out thank you guys
oh is there any software that do it?
Can't even beat me in telling people if you have the time. tsk tsk. Gettin' slow in your old age.
because my internet dosnt work with port forwarding its a WHOLE thing with my internet provider
If you aren't using Steam etc., then you'd need to Forward the Ports via your Routers Interface, usually accessible via the Routers IP and whatever login you have for it.
If that's not an option for you, then you can already start planning for Steam or whatever else allows you to host without having to do that.
wait should i get dedicated servers if im wanting to make a battle royale game?
Depends. Maybe your BR game is only 4 people.
I'm laying in bed with a laptop on my lap, cause i'm freaking tired from dealing with an NPP/Mover crash one half of my day and MotionMatching Turn In Place the other half.
All I allowed myself today was watching 2 episodes of Scrubs with my wife.
Then I went to bed.
;_;
We're trying to finish Cobra Kai. I'm sure we'll go through Scrubs again in like a year.
Very good. I got Stargate SG-1 and Atlantis for my Birthday. Nothing beats the older series.
does anyone have videos for dedicated servers
You honestly probably shouldn't be aiming to make a BR game if you don't understand the absolute basics of networking in general. This isn't a dig on you either. I'd say do a simple co-op game first.
Don't know anything about "your BR game", but if it's anything like other Brs, then yes.
Also this will cost a fortune in hosting costs.
And yes, don't do a BR game please. This is way over most peoples heads.
how do you do console commands that works for Uobjects ?
exec commands using UFUNCTION are easy but you cant name them as you want, cant give tooltip
The Multiplayer part for that will be difficult enough.
Pretty sure you can register Console Commands?
i get weird issues
Also why is that in #multiplayer
With pvp stuff, you actually have to consider cheating. And more accurate hit detection. So much extra work.
issue only happens when multi users (PIE sessions)
A proper BR game probably needs a 2 to 3 digit sized team at least 2+ years.
If you cut a lot of content and close both eyes you could get away with 1 /4 of the team size and a year of development.
Can probably find some YT video that made FN in 6 hours though. BP only as well.
But you'd probably also end up with a dead game :D
You will need to explain what you even mean with issues.
Whatever the issue is, could also be because of one process mode.
im registrating this in character ctor
FConsoleCommandDelegate::CreateWeakLambda(this, [this]()
{
bDisplayDebugWindow = !bDisplayDebugWindow;
}),
when bDisplayDebugWindow is true, on tick a ImGui window pops up with data collected from the character.
when i call the command on listen server, it displays the window and data correctly
when i call the cmd on client, it displays the window, and the listen server character data is somewhat used
maybe, i didnt tested in multi process
We usually have a Player Selector Widget in ImGui to select the different Pawns on different processes etc.
If you change Console Variables I'm pretty sure they change for both sides anyway.
We don't open the windows with that.
PITA
so i got this issue for everything, imgui windows, debug draws ...
my only possibility is static variables ?
Idk, sounds more like you need to figure out what Player you want to draw debug information of.
OKAY i actually managed to get it working. However I have a system setup so that when you shoot a prop that Isn't the player you take damage, once you reach zero you die and if no hunters left the game ends. HOWEVER, that system for some reason only works for the Host. How can i resolve this. can send screenshots if needed
making me go crazy
May not be replicating stuff correctly.
But showing code would be helpful. For both parties.
show each bit of the code, starting from the shooting input
so i should do a command that has the index of the player controller for the server as param ?
this is annoying depending on testing conditions
input -> the shot -> the hit -> the damage -> the game end check
small screenshot spam then
say which class each bit of code is in too
start at the input
if i shoot the prop (aka the other player) it eliminates them and the round ends fine though
whether u r client or host it works on both
PlayerState might be better for you want to debug SimProxies in the futur
im starting from a template, also the most recent screenshot is from the parent class
This is sus, it's always gonna be the host
the instigator isn't the hosts PlayerController, it's ThisPawn's PlayerController
hmm oke
modify this to only call Shoot once, and to choose to eliminate the thing that got shot or to damage the shooter
I see, still a PITA
Unsure if I should ask this here or in the online subsystems channel but I'm wondering what's a good way of handling persistent/meta progression for players who choose to play online, without having a player hosting a server? In other words, I'm curious which sort of multiplayer framework I should use.
I want players to be able to play in either solo (offline) or co-op (online, with statistics, persistent character/meta progression saved on a central/dedicated server somewhere) modes (separate options in the menu, of course), keeping player progression separate for both. Should I:
- have players create listen server sessions and periodically upload their progress (authenticated) to a dedicated server while playing during the sessions?
OR - have players join a dedicated server/one of several dedicated servers - through matchmaking or some method of joining friends - where the dedicated server will handle all the progression stuff directly?
OR - some other suggested method?
(In any case, singleplayer progression will of course be stored locally on the player's computer and be completely separate from online progression.)
The reason I ask is because I'm not sure if I should be digging down the dedicated server rabbit hole, but I'm also not designing my game with listen server networking in mind as I prefer the server to be headless and not hosted by a player. Perhaps I can be convinced otherwise.
If the progression matters, an authoritative dedicated server calling the shots is the only way. If it doesn't matter, player hosting can save lots of $$$
anyone dig into this MultiServerReplication plugin yet?
expectations are fucking flatline but kinda curious
Hey, If I call a reliable server rpc and then call another reliable server rpc, is there a possibility that the later is called first, I am asking this because I am doing some client side prediction stuff and wondering if I could have any kind of bug in case this would happen
If it's in the same actor then reliable RPCs execute in order
But if you call the same reliable RPC on different actors it's not guaranteed one would run after the other
In my case it is in an array of structs
That also applies to Components then, right?
As long as they're in the same actor yes
okay thank you very much
I've a strange problem, my pawn's location is sent to the clients even though I have replicate movement off.
I'll make custom interpolation but it constantly overrides my client positions, setting the Net Update Frequency to 0 solves it.
Why would my client position get overriden by the server with replicate movement turned off? (Pawn is not physics simulated)
hello can anyone help me i have multiple different character blueprints and want to spawn a random one when the player connects
@dark edge ok its running under one Shoot now
I'm looking at some code that is crashing because of an invalid this pointer, in a member function that's being triggered by a delegate after a map load has started following a network error. I thought this kind of thing wouldn't happen because the delegate's reference to the object would keep it from being garbage collected before the delegate's owning object. But now I'm not so sure...
Delegate references are weak
They will not keep an object alive
either need to unbind on the objects death or use AddWeak methink
ah, well then that makes sense
I have to keep NetUpdateFrequency at bare minimum, what is wrong with my Unreal
Gonna have to tell the owner of this code to change it then
@verbal ice @exotic wasp thanks!
correction on my end, AddWeak is not a think i dont think and i dont know why i said it. AddUObject should keep a weak reference
I'm guessing Zinac is passing more UObjects as arguments to the binding, right?
hmm actually it does look like they are using CreateUObject(), which claims to create a weak reference
Can you show code? That's pretty weird then
what is CreateUObject()?
ahh
yeah that. But also I just found ::CreateLambda
If you're dealing with UObjects, you should use CreateUObject
or CreateWeakLambda at least
lambda definitely will not hold a weak reference and will happily dereference trash
yep this is it
Am I allowed to post video in here, I need some feedback and that stuff to show just abit of my work in the past 2 days haha
CreateWeakLambda(TheUObject, [TheUObject](){...}
Probably better here: https://discord.com/channels/187217643009212416/1054845120236757103
assuming you dont want a named function yeah
@verbal ice thanks mate I did upload but not had any feedback I'm new tbf and I'm kinda proud of it so far
they're just passing in a this pointer as a capture
Yeah not good
Just pass this as the first argument of CreateWeakLambda and it'll fix it
ahhh yeah
Anyone have issues with OnLanded being flaky? Sometimes it just doesn't get called even when I watch my character fly through the air and hit the ground. I suspect it has something to do with corrections, but I'm not sure.
@thin stratus I think I found an issue with my modifiers. When corrections occur it can rewind the start/stop modifier event, and when replaying the move it isn't being called again 😦
Very rarely but it has been an issue in past projects
Are OnRep variables suppose to set prior to BeginPlay executing? I’m testing with bad emulation and sometimes when I add a client, that client will execute BeginPlay first on that actor component and then OnRep. Then I’ll add a second client and it’ll execute OnRep first for the variable on that same actor component and then the BeginPlay.
Is this just the way it is? I was hoping it would always execute OnRep before BeginPlay
No guarantee of order
rep notifies can be called before BeginPlay and vice versa
Oh gross… that’s a bummer. safe to assume then the actual variable being replicated can occur before or after begin play too?
Like I always assumed the moment the variable was replicated OnRep was called. But I also assumed OnRep occurred prior to begin play
Yes, the variable being replicated is why OnRep is called before BeginPlay
If the repnotify is called the variable got replicated
You have a nice guarantee with the engine: initial replication of a UObject is guaranteed to have all of its unmapped replicated properties available
By unmapped I mean any replicated property that isn't a UObject
You just have to handle the rep notify and BeginPlay being out of order in your code
I am confused on this front, I guess I’ve only done replicated stuff through UObjects as it’s not often I work on non-UObject classes in UE
Also, if you pass a variable via constructor that is a replicated variable, then in that case, the replication must come through prior to begin play - correct?
I think I’ve done that in the past 🤔
If you have an actor, with the following replicated properties:
int32 SomeNumber;
FString SomeString;
UObject* SomeOtherObject;
When the actor is initially replicated to a client, you are guaranteed that SomeNumber and SomeString will have the replicated values ready. SomeOtherObject however may or may not be there yet.
Like creating an actor at runtime
This is because SomeOtherObject is a reference to another object that requires mapping. If the other object isn't available on the client, the value won't be there.
You're guaranteed that the value will be there on the frame the UObject is created on the client.
Not entirely certain before BeginPlay
At the very least the rep notifies might not have been called yet
Another guarantee is that, on a frame when an actor is replicated, all of it’s changed properties will be sent at once, and the client should receive and apply these changes within a single frame (with the exception of unmapped properties). However, there is no guarantee made regarding the order in which properties will be received or the order in which OnReps will be called. Any order is considered an implementation detail that should not be relied upon. If the order of an actor’s property replication is important to your game, you may need to implement OnReps to track which properties have been updated on a frame. After the replicated values have been received and their OnReps called, you can handle the changes in the PostRepNotifies function. You may also need to save certain received values in their respective OnReps until they’re ready to be used.
Ok, I think I’m understanding it - thank you so much! I’ll also read up on that article 🙂
im unable to move due to enchanced input mapping when spawned how do i fix this ?
show code
ok 2 secs man
its just the default third person
but only the server is able to move
client cant move or look
Possessed is a server only event
I think the client variant is AcknowledgePossession
or OnPossessed on the pawn
something like that
could i change event possed to a custom event and call it from spawn player ?
Yes
You have to do it on the client though
Not the server
Without knowing more about your setup I'd say to just do it in BeginPlay in your player controller, check if it's on the client side and you're good
I've a custom movement component that works fine in the editor, the client mode works correctly. Even on bad network emulation it doesn't break.
In standalone build it also works fine. But when I test it in a dedicated server it blows up
Are there stuff I cant do in dedicated servers? Why would this happen
Only happens in the dedicated server, listen server is also fine
why :c
sometimes I want to uninstall unreal
Describe what blow up or doesn't work?
Ive an edge detection function for custom navigation mesh, it works fine on standalone and listen servers but for some reason returns null on dedicated servers
Im suspecting the dedicated server is interpreting some warning as an error and acts extra dramatic when it doesnt need to
Ive been trying stuff for 4 hours now with no success
put prints everywhere and identify the break point
that wasnt it either, there are no warnings whatsoever now and it still doesnt work
In the editor everything works perfectly with no errors no warnings no problems
Only in the dedicated server it breaks, I already know which function is causing it but theres nothing wrong with it
Can dedicated servers not perform cpu access on static meshes?
That's all I can think of, I need mesh data for edge detection maybe thats what's failing
are you saying when you build the game, it doesn't work? or when you run the game in standalone game?
and do you mean in PIE it works but in standalone game it doesn't?
because standalone networking mode and standalone game mode are two separate things
In PIE it works, the standalone build works, when you connect peer to peer (listen server) it works
But when you connect to a dedicated server it doesnt work
ok so Client networking mode doesn't work?
Client networking mode in the PIE works
There are no networking issues, something breaks only in the dedicated server
ok so doing the actual connection to a dedicated server you've set up breaks something?
It's not a networking or a connection issue, the problem is the code breaks only in a dedicated server build
It's the exact same code that runs in a standalone build or in a listen server
I would say it's fair to assume it's a networking issue, because otherwise it wouldn't be affected by how you start your session
there are some things that behave differently even between PIE and Standalone Game modes
because of the order of operations for initalizing certain things like player controllers and pawns
Im aware of that and that can't be the problem because there are no problems in listen server configuration in a packaged build
you might have to do some work in the game instance and/or game mode classes, if you don't already have custom ones
listen server is not like dedicated server. dedicated server is headless and does not depend on a player to host the server (in which case, if you are the only one testing listen server, you will get different results compared to testing with multiple clients in listen and dedicated server setups), though I'm sure you're already aware of that
hard to really say what should be done without a more in-depth explanation of the issue, or without digging into how your game is built, I suppose
I know, same result with multiple clients
There's a server side calculation that's going wrong only in dedicated servers
but back to my original suggestion; prints everywhere. do they not show up in builds? you might have to log the prints on the dedicated server itself
I'm making a build with a shitton of logs everywhere now, hopefully this time it will provide some insight
good luck. sounds like a tough issue to identify
im trying to make a multiplayer movement shooter to play with my friends in blueprints (i dont have enough braincells to learn c++). im trying to replicate a movement mechanic that involves being launched at high speeds across the ground. it replicates and i made basic client prediction so there's no input lag, but i dont know how to correct the client smoothly and i dont want the regular rubberbanding to happen
In theory that is sadly not really possible with Blueprints. Cause you'd need to code that mechanic into the Character Movement Component
can i make the normal rubberbanding smoother somehow?
What parts of the engine net code is not suited for high player count? CMC or everything starting from where the engine gathers actors for a connection to replicate to in NetDriver?
I'm trying to avoid reinventing the wheel with my custom net code and use what is already there that is efficient and replace or extend what is not
I understand I need to profile, I did some tests and profiling in the past and I recall CMC was the killer, But forgot if there was something else that needs replacing due to taking a long break from programming in general, Also lesson learned, write down the tests and profiling results next time
CMC is heavy by default, you can tweak some settings to reduce bandwidth usage, for frame time idk what can easily be done to reduce its length.
Potentially by changing the interpolation settings on the CMC in your Character BP.
But you can't get rid of it entirely. Main reason is that you would usually need to send a flag (or a boolean) via the ServerMove RPC of the CMC to the Server, which then is also kept locally in a SavedMove.
When a correction comes in, that SavedMoves allows the Client to replay every move that hasn't been acknowledged by the Server yet.
But since your custom movement doesn't have that input, or any of the data that is usually needed to be kept there, in said SavedMove, it can't replay it and then you get strange results.
ok ill try
(i dont have enough braincells to learn c++)
Also, just to encourage you a bit (or maybe this has opposite effect?), Multiplayer is potentially more difficult of a concept than C++.
I'm trying to replicate the movement of a boat. The boat is a pawn and I'm using a custom buoyancy system. It uses add force and add torque to move. When testing in both the editor and a built version I notice consistent lag and jittering on the client while the server behaves normally. Without network emulation the issue is already present and when I set the network emulation to bad the movement becomes completely broken and unplayable.
The boat's root component is a static mesh with Simulate Physics enabled. I’ve tried Replicate Movement and RepNotify, but neither worked as expected. I also tried to run physics on the server, experimented with unreal engine's built in Physics Replication Modes, and integrated Smooth Sync, but the jittering persists.
How can I achieve a smoother boat movement
Correction stops the current montage of the character. Is there a way to not do that?
and is there a setting I can change to increase the treshold for the correction?
Kinda butting my head againts the wall to do attack montages.
I mean logic wise, it's as simple as
Ability Activate -> Client play Montage
Server Ability Activate -> Server play Montage
but I keep getting mini correction that totally break my anim
Well, you don't have net prediction like CMC has, so that is expected
CMC only takes a vertical capsule so you probably won't be able to fudge it for that purpose
I haven't looked into NPP for something like this, but I don't hear great things
Some people have rebuilt CMC from scratch to support cube/horiz capsule but that's a huge task even for the more experienced devs
This isn't normal, corrections shouldn't end the montage, what node are you using to play it
PlayMontageAndWait from GAS 😦
Yeah that shouldn't have a problem
hmm
You're using a local predicted ability? Not running separate logic for server?
Im predicting the activation
As in the only thing you have is ActivateAbility -> PlayMontageAndWait
but the server eventually call the same func
Yeah this is pretty much it
Oh then your prediction key is probably getting rejected entirely, and the ability never ran according to the server
That's the only reason de-sync would end the montage
Toggling this stops the montage from ending
but I get correction again when turning it back on
and the Abilities run on both side I believed, since I can see the attack montage playing in both server and client
The amount of non cmc/physics based movement questions here recently make feel like I'm falling behind a trend or missing some core knowledge that I should be knowing
Sounds like its related to how you're triggering the ability
🤔
i will look for something
You're not
CMC is still the only adequate, battle tested, suitable solution for net predicted movement
What do you recommend I do to fix this
I'm not someone who could rebuild cmc from scratch and probably using cmc would require me to change the boat completely
using steam online subsystem
pretty sure it's up because the steam layout did popup when shift tab
but when I play in standalone mode find sessions advanced failed
does anyone also had this problem?
I'm not familiar with advanced sessions plugins but could be due to how you configure your session settings or subsystem (ini file). What kind of options does it have to create a session?
Where can I even find a good source that uses GAS in multiplayer correctly?
Lyra breaks down with high ping and tranek's example project doesn't even replicate a lot of things.
even the reload is not replicated 🤔
Do you include GASShooter to tranek's example as well?
Yup
Nvm movement
But the reload isn't replicated
are you using 2 steam accounts to test?
1
is using seperate accounts essential?
Lyra is also a garbo project. How is it meant to be the standard. Play with 125 ms and things break right away.
Yes and multiple machine.
Can't run 2 instances in the same computer and join each other.
use multicast?
the other players only need to see your reload animation (probably)
Any idea on why my character would be stuck in t-pose on match start on client if I increase net priority on player controlled characters?
TPose is a local thing, server doesnt care or replicate animations/montages by default, you need to ensure the client is also setting the anim instance on the given player
i want to make a multiplayer game but i want there to be zones that will load and unload on client side
i tried data layers,but the way it's done
is i can either have the server turn the layer on/the client turn it on,but only for it self and if i have collision on it,it would be diffrent from the server so it would not work correctly
It does, if I check on tick the name of the anim instance & the linked layer it's all fine
i'm wondering if the world partition is a good option for this,but i guess it's totally on the distance of the player controller
but I'm not sure why it would be a problem if I increase the priority
what are you having issues with in GAS? replication should be fairly easy
the only times you'll have to custom make things afaik is getting specific data from client-server or with CMC
I actually don't have a recommendation. You basically need to learn net predicted vehicles. Maybe #chaos-physics has info. I am very character focused myself
If you want to see what the server is doing animation-wise you can use my plugin's function DrawPawnDebugPhysicsBodies
https://github.com/Vaei/SimpleAnimation
What you're seeing is almost certainly specific to your project and not an engine issue tho fyi
for correct CMC movement replication with the character capsule, am I forced to use AddMovementInput ?
how would it work if i want to snap the player to a surface (climbing cylinder surface left and right)
The input vector from AddMovementInput gets consumed to build Acceleration which is net predicted, so yes
That is basically a request for a tutorial 
to make it simplier, where does the CMC move the capsule component ?
In a lot of places, even if it was only one place, it won't make it simpler for you 😄
well i guess its way hard then i thought
i ideally wanted to temporarily hardcode something
Hardcode isn't a term that has any meaning in this context
If you want something quick and dirty then do it in SP via BP
There is no quick MP solution
replicated physics is a very deep rabbit hole
not recommended unless you know exactly what you're getting yourself into
it's difficult even for most professional devs. most physics stuff is relegated to cosmetic things that don't affecte gameplay, generally
pretty much all th exposed stuff, like is dedicated server is lan private and public connection amount, etc.
example of advanced sessions node (left) versus default online subsystem session node (right)
(on top of that, most of the relevant properties have actual informational tooltips)
Hi 🙂 I need help with a system i have. So i have it so when you shoot props that arent the other players hiding as props you take damage, when you reach 0 health you become a spectator. However, that only works for the host and not the clients, when they reach zero nothing happens. any help would be great 🙂
What was the result of yesterday during your help session?
You have to make sure the host is the one managing the damage and making the client's player controller that is defeated is possessing the spectator pawn.
What did you change from that time period?
I was able to get health and such working for both the host and client, was also able to get the host to become spectator when they die. However after a bunch of trial and error i didnt reach very far. I am very bad with blueprints and not very knowledgable so being able to get something working has been hard xD
@sinful tree what do you mean by make sure the host is the one managing the damage? the damage is being held by the Server rn, is that what you mean?
Any damage that is applied needs to be applied by the server to ensure that a client's character is properly being damaged. If you're sure that the server is the one applying the actual damage, then when the actor is dead, and assuming your damage dealing code is within a pawn (or character) already, it should just be a matter of spawning the spectator pawn, getting the controller of the pawn where the damage was applied and making that controller possess your spawned spectator pawn.
If you're using something like "Get Player Controller 0" that's the wrong node - you want "Get Controller".
that would be plugged in under possess right?
the get controller?
also, where should that be handled you think ^ i currently have the turning into spectator handled in the GM
Yes, controllers can possess pawns.
It doesn't matter where you call possess, but you need to ensure when you're spawning the spectator pawn that it is being possessed by the controller whose pawn was defeated.
so would that be a get player pawn?
No
Are you using the built in damage system where you call Apply Damage and then implement the "Any Damage" event?
yes
Ok, so that means that Any Damage event is in the pawn that is currently possessed.
yes
You can get controller of that pawn. You can pass that controller reference to a function in your game mode to then do the spectator pawn spawning and possession.
oke cool i got it to work for the client, but the body remains in the scene after possessing the spectator. i know there is a destroy actor but idk where id put that in the line
unless it could be handled better @sinful tree
Destroy Actor should always be the last thing called within an actor.
fantastic, now i just need a way to make it so that when there are no more hunters, the hiders win
but thank you for simplifying that, ^ its working now, just need this system to work and im all good 🙂 @sinful tree
My attack montage keep getting cancelled from what seems to be correction. If I untick correction, my montage will keep playing but switching back on cause huge correction.
I suspect waiting for target data to be ready may cause de-sync. Since the rpc can come anytime. Maybe it's the delta time between waiting for target data and the execution of montage that cause de sync. I have no idea at the moment.
Hi guys. I want to make a replicated Anim montage event, but I have a really strange bug. When my character on the server push, doesn't update the movement on the client.
On the Left Side is the Client, on the right side is the Server
At client everything works well
but on Server this happen.
Anyone has a solution please? Thank you.
Which one is the client in the video
Left side is the Client
At Client the Server movement doesn't refresh
I use the motion matching project.
This shouldn't cause a problem
How does the animation pull the player velocity/input? I think it might be the one that's getting stuck
I’m so frustrated. Game works fine in the editor, but then I package it, and run it with my friend. All of a sudden when my friend disconnects (as the host), it doesn’t send me back to the lobby like it does in the editor. I have it set on network failure to do that, but it just spawns my character outside of the lobby falling.
THEN I created an AI, with a behavior tree. The animation montages are not playing on the clients, but they do on the server.
It’s just so incredibly frustrating because it takes forever to package the game, send it to my friend, have him run it and I run it, after making 1 change to see if something is working now.
Is there a better way?? How would I even begin to debug?
Just calling play montage would only play on server, you have to play them on everyone by multicasting
This is how I have it to call now, which was weird because 2 days ago in the editor, without the server and multicast nodes it was replicating to both clients.
Anyways, I added the Server, and then Multicast this way after I saw it in a tutorial. Is this correct?
Its still not replicating.
You can also run the editor on listen server configuration and test it before packaging
Some stuff may still act differently on packaged builds tho
Whenever I test, I usally run as Listen Server, and then check both the Client and server to make sure its working, then i usually play as both clients, and it still works. But when I package its broken.
Don't play montages directly in the behavior tree task, call an event on the actor that will play the anim
Just to give you context. This is a character who runs on a loop every 15 seconds to do a quirky action (its normally a 40% chance, but for testing i have it at 100%).
In the behavior tree, it checks to see if the chance was enough to do the action, then grabs a random number between 0-4. This corresponds to one of the tasks.
(Complain, Punch, Dance,etc). The Run off task works correctly because its just ai move to. The Punch task works and replicates, but its a little different because it calls custom events that are on the characters themselves.
Wow lol read your message as i pressed send. Let me see if that will work.
Yeah the punch replicates correctly because the task is calling it on the actor, not directly trying to play montages on it
Dont put gameplay critical stuff on behavior tree tasks, make them call the events instead
My only question is how can I let it know the task has been executed back in the behavior tree, after the animation montage has finished playing on the character?
You could just use a dispacher
Maybe a delay node, which is the time of the animation?
It would work but that's more like a hack than a solution
Agreed. Let me look at the dispatcher!
Also, in the editor, as client and server it does correctly replicate now.
Once I get the dispatcher working, then I’ll have to package and see if it works there.
If it does, I can move on to my next problems lol!
You could also have a flag or a gameplay tag that indicates if an action is already being done
The tree would just check that (before executing anything else), you wouldnt need to use a dispacher either
Like this?
this is when i set my character as Downed, I needed it to not attract any monsters. So when they see my character and he has the downed tag they do not follow him or damage him.
Kinda yeah, but using gameplay tags for those things is safer
with a string array you might get some race condition problems
Oh okay, I haven’t used gameplay tags quite yet.
I’ll try to go look into that, and figure out how I can implement it into the tree.
Thank you for the help
I have a question about MMO architecture, not that Id want to make one just love knowing how things work, is what I have below the general gist of it or am i way off
game launcher
-> user logs in with email/password (or some other auth)
-> launcher posts to login server
-> Login server looks account details up
-> Login server responds with a auth token
game launcher launches game with token as parameter
-> first game map requests user and server information using auth token
-> login server responds with region and user information (such as user_id)
-> game populates widgets with servers/regions
-> user selects server in a region and the game connects to this server
Region server is just a main menu with character creation/management
-> Region Server accepts incoming connection
-> it requests the user ID from the login server using the auth token
-> it uses the user id to look up characters in its own DB with the users ID
-> user creates a character, the region server will add a new character to its own DB
-> User selects a character, region server already has this character information, such as last known location/rotation
-> region server selects a cluster GAME server based off this location (e.g. its cluster 4 part of the map)
-> region server knows we have several fragments currently up for this server with fragment 5 being the lowest populated
-> region server will connect to cluster 4 on fragment 5
Cluster 4 fragment 5 accepts incoming connection
-> It requests the character information from the main regions API
-> it loads in the character at said location and rotation
-> every time the character updates (or can be run as a job in the background every so often) it
will post to the main region api updating character information.
And some more info explaining what i mean above
Login server is just an API with a database
Region main server is an API, DATABASE and single game instance of a character screen level.
it can have several clusters and each cluster can fragment up several mirror images of itself,
clusters and fragments can be spread across seperate datacenters and on virtual machines or dedicated servers or all on the same machine.
each one talks to the main region servers API which updates said DB.
My only question is why would you need an entire game server for just handling lobby related stuff like character creation
That could just work on client side, you'd connect to a gameserver when you already have created and selected a character
You can fetch/send the character data to your API from client side without needing to connect to any server
yeah true, just use the region api for the character info.
then on character select have the api return a cluster/fragment ip
yeah it eliminates a lot of ambiguity, the simpler it is the better
so essentially what I have up there looks right, the region api server would also have to have another service running in the background which would spin up new fragments (based off total connected players and a max count). and a fragment is just a game server instance.
yeah thats awesome. haha
Yes, the animation in play rate the problem... No input issue.
I have no idea how to solve it... If the play rate 1,0 , work properly, but the character is stop the movement. I want the character to be able to push while moving.
If I pull the play rate from the traversal, the character can push while moving, but the server animation only gets stuck on the client screen.
Are you altering the play rates to layer animations? I don't understand
This was it. For anyone planning to do some dedicated server work, Dedicated Servers cannot access mesh sections! They seem to only have collision data!
I solved my problem by baking the mesh sections into a data asset in the editor before packaging.
(And it doesn't even put up a warning or an error saying it doesn't have it, simply returns an empty array as a middle finger and refuses to elaborate)
Thx for the help yesterday
No problem! did you figure out what you needed?
yeah, this
Yeah, but at least baking the section data should also have some performance benefits, not sure if it was worth the 2 days of headaches though
I still have a problem with the pawn replicating its position even when Replicate Movement is off though
I can't implement client interpolation because of it, movements in the client side look choppy.
Why is unreal so stubborn
CMC interpolates the sim proxy mesh instead of pawn/character
i.e. you could/should? probably do the same
I'm not using CMC, it's a custom pawn not a character
wait, sim proxy mesh?
So the pawn that other players see (i.e. not the one you're controlling)
It takes the mesh from that pawn that represents them
And smooths the mesh's translation/rotation
i.e. smooth the mesh between the last actor location to the new actor location
Well, you wouldn't do a lerp which that phrasing kind of suggests, because you don't know when you'll receive the next, you just interp towards the current
You could look at how CMC does it
I really dislike how they tied both translation and rotation into a single net smoothing mode tho, should have a setting for each
So I shouldn't try to interpolate the actor position, but the meshes inside of it?
Wait I was already doing that for the player camera, yeah that makes sense to apply to other stuff as well
Eh, you live you learn. At least you know now for next time!
you are likely not sending the replicated movement to all clients (multicasting) from the server
it should always be Client presses button (movement in this case) > server confirms that client sent the command, sends command to all other clients It could perhaps also be that you're changing movement variables like movement speed, but those aren't getting replicated. RepNotify is your friend in this matter
No that's not the issue, it's the opposite. I wanted the actor position to NOT be replicated
For what reason?
Even with replicate movement flag turned off, unreal force replicates the transform
But it's choppy?
Wanted to make a custom replication for it to smooth out the client side
choppiness is usually the result of the server taking authority over the client when it comes to replication (in this case, position snaps to server's position each server tick)
if you want it to smooth out on the client's side, you could probably just extend wherever the movement is coming from to also play on the client simultaneously
The issue is I can't do that very easily, I'm using a custom nav mesh for spaceship interiors that players walk on. And that mesh is constantly in motion simulated by the server.
So it was best if the engine didn't do any automatic movement replication at all, because it clashes with my system
Turning off replicate movement sadly doesnt have any effect and it still overrides my positions
I think I'll just surrender and do sim proxy mesh interpolation instead like Vaei said
Before
After
Both are clients, with average network emulation
Im so glad it works smoothly now, thanks @swift sorrel & @grand kestrel for the ideas
I am having trouble with the error Accessed None, when trying to get my widget reference (Health Bar). I am having the same error with the ABP reference, but I moved it up in the timeline of initializing things, and added a small delay to referencing it somewhere else in my character. (Still having the same issue).
Not sure what I should do here for the W Hud Reference!
That's a weird setup and there are stuff you might need to check again. But I also don't see a reason for the Hud Ref to be null inside the GetHealthPercentage function, unless you're calling it from somewhere else as well?
It’s from a downed player stats tutorial from Matt Aspland!
I’m calling it when I damage the player, and whenever the player actually goes down.
I have a keybind (U) that damages the player for 10 health, and that’s when the error pops up.
Why on earth do you need a reference to the anim bp.
Your system should work without it and also why is it a replicated variable.
The instance don't replicate
Also there's no guarantee that they are already replicated even if it can be replicated.
The only time you can ensure something replicate is with rep notify
When the player goes down, the float changes to a downed float, and the text color is changed to red.
I still don't understand how is it relevant with you trying get the anim blueprint.
For the things you could look into about
- Widgets and ABPs don't replicate, setting their variable as replicating is useless and won't work
- You're setting those replicated variables on client. Yes they already don't support replication but even if they did, it still wouldn't work, you need to set replicated variables in server and server replicates the latest value to clients, that's how it works
- You don't need to send client RPC on Posessed event, client should also have a function that gets triggered when the pawn is possessed (don't remember the name or if it was available in BPs though)
GetHealthPercentagefunction.. is weird. Pure functions aren't just cosmetics to make them work without the white pin, they get executed for every pin they are connected for. So it's better to make them little to nothing (like just returning the value) or change the name fitting to the context and make it non pure (just a suggestion)
This is a tutorial? wow
Not surprising.
Bp multiplayer tutorial in youtube is peak garbage
With thousands of victims thanking shitty broken codes
If they're able to earn money or reputation with these, I'm getting in as well. Easier than trying to do something right lol
Pretty sure Stephen ulbardi from udemy earn millions from his tutorial.
At least his content is pretty good. I would say on par with Tom looman
Hey guys, in today's video, I'm going to be showing you how to set up a knocked down and revival system. This is also replicated and works for online multiplayer too. This is part 1 of 2.
Part 2: https://youtu.be/_hlnD4M0Lsc
Animations: https://matt-aspland.itch.io/downed-revival-system-animations
Due to not being able to import single frame ...
where in this tutorial does it even say to set a replicated widget
lol
damage already run on server
Also why server call damage on client
?????
K he subtract hp with client rpc
Just close it man, garbo turorial
That's it, I'm releasing all my missing and partial knowledge to public from now on
This is just one of shitty tutorial
You should see someone spawning with multicast
And everyone went omfg i finally get it to work thank you
everyone gotta learn somewhere man 😛
Yeah the pinned material on this channel.
Not youtube where they teach you the incorrect way.
I apologize if it’s a little hard to read. But that’s the full function.
So I need to remove the replication from W HUD ref, and the ABP ref?
And event possessed should go directly into the cast to player controller, instead of calling the “client create UI on the custom event”?
I don't mean to attack all content creator
.
Eh I don't like myself for saying this but you might need to learn the basics first, even trying a singleplayer first to get familiar with the engine and then multiplayer to split their complexities into 2 different learning paths.
If you're just new and trying to do this specific thing, to get your hands warm, try to replicate the video as is for now, get adjusted to the editor and stuff a bit. But be aware this is not a tutorial that will teach you something that you can use in the long term. Please unlearn everything in the video later
As for the question though, ngl I still am not sure why you get null ref from trying to use HUD, you seem like set it before you try to access it
Thats where I am confused also. Gonna go and look at my references again. This isnt a delay is needed type of thing right? Just saw posts where people mentioned that the variable was being referenced before it was initialized.
Since there isn't any actual replication is going on, no there isn't any need for delay or being sure that the variable is initialized. You apparently do that in Client_CreateUI, before calling GetHealthPercentage which is where it's being used
Maybe you can try to put breakpoints where it's being set and where it's being used to see if you call the function from somewhere else before you get your possess though
Are the error messages printed only when you press the U key?
If its any use at all, If I play as 2 Clients, Client 1 Can see his health correctly and it doent cause an issue, but Client 2 doesnt even have a health bar lol
And yes! U dmgs the player for 10 health
Thats when the errors occur, or when dmg is taken
How do you deal the damage?
Looking back on the tutorial, it had me create the widget in my player character. One of the issues I was running into was that when I spawned In the lobby with my friend on the test build we could see each other go into the downed state, and our health bars worked fine! But when we server traveled to the next level, his health bar disappeared and the downed state wasn’t replicating correctly.
So do you think moving it to the player controller will fix the issue? Since it will not be destroyed like the player character is?
It's the same just add a loop check to make sure the controller is assigned before continuing
This isnt a solution just a hack to see if it's a timing issue
Sometimes stuff don't get loaded/spawned yet on clients when they are already assigned on the server. So that may create timing problems that lead to null refs
Wait
Why is your widget variable set to replicated?
If that runs on a listen server the variable in client will be overriden by the server's hud, which doesn't exist in the client. That can also lead to a null ref
nah nvm it's was in a client rpc that shouldnt happen
You still don't need to replicate widget variables though, they only exist locally anyway
Controller should also be getting destroyed on level change, everything related to the world should. Were you doing any setup/stuff in GameMode::PostLogin? Just idea spitting but if you're using seamless travel PostLogin doesn't get called again for map changes for example
Hello, I have a question about replicated timeline components. 👋
Are replicated timeline event track triggers reliable? Will these execution pins always eventually fire on the client?
Any advice would be appreciated. 🙂
Cheers.
I think it only replicates the play rate, play direction, current time etc so it's synced to clients when it plays
I wouldn't rely on them
Thanks, Spynora. I think it does fire them but I don't know if it's stateful so I guess I'll just move that logic to an RepNotify. 👌
hi does enhanced input have to be set in a way to make it work for networked games?
whenever i join as the client this returns invalid
Hey is it possible to do something like this:
Create a macro to reduce my redundancy when creating a lot of replicated properties that all do the same thing OnRep?
I ask because it seems not to work, I get this error Failed to find Property CameraZoomSpeed when DOREPLIFETIME_CONDITION_NOTIFY(ACorpPawn, CameraZoomSpeed, COND_None, REPNOTIFY_Always); is called.
// Macro to simplify property declarations
#define DECLARE_PAWN_PROPERTY(Type, Name) \
UPROPERTY(replicatedUsing=OnRep_##Name, BlueprintReadOnly, Category=CorpPawn) \
Type Name; \
UFUNCTION() \
void OnRep_##Name(Type Old##Name) \
{ \
HandlePropertyChanged(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(ACorpPawn, Name)), Old##Name); \
};
// Declare properties using macro
DECLARE_PAWN_PROPERTY(float, CameraZoomSpeed)
//... Declare more properties
#undef DECLARE_PAWN_PROPERTY
i might be wrong but i dont think UHT allows you to define UPROPERTY variables through a macro like that
Hmm yeah I did just find this: https://forums.unrealengine.com/t/declaring-a-function-with-c-macro/1251989
Someone trying to do something similar to me said
I feel like [it's not working] because UPROPERTY is parsed by the Unreal Header Tool before C++ compiler handles the macro
Which seems to echo what you're saying. That's unfortunate, it would make my code a lot more concise 😅
is your actor set to replicate?
yea it is
how are you calling the rpc
I packaged my multiplayer game. the game opens, I open it on 2 different computers and I set up a server on one of them but the server shows 9.999 ms so it breaks when joining
i called it on begin play and on possessed to try, its a client RPC and i even did a server rpc calling the client rpc.
this is on the controller
It doesn't need to be in an rpc, you can call it on begin play directly
try removing the is valid node, it doesnt work on the enhanced input subsystem afaik, returns invalid even when it is
oh okay ill try this
thanks
did this , yet doesnt work
reparenting my game mode to gamemodebase from gamemode fixed it
yea, never depend on delays in that way, if you can. it's a surefire way of having things break later down the line and having to remove and rework stuff that you would have done anyway the first time around. generally if you are getting a null reference, it means the server or client aren't getting/receiving the information properly, somewhere. sometimes it's as simple doing an "is valid" check on the thing you're setting before using it, sometimes it's something you have to hook up somewhere up the logic chain (ie. before setting the HUD variable) that's related to the thing you're setting (usually a controller or pawn reference).
I had a case like this which stumped me for a while. it ended up being that I was trying to get a component from a reference to an pawn in a really bad way (using "get component" by index, rather than just getting the component by name directly) which led to a null reference. there are some really weird things with the engine that can change between running in PIE or standalone or cooked build that are hard to track and hard to fix without knowing the pitfalls. in my case, for some reason, the index of an actor's components (position of parent/child relationship of components in an actor's hierarchy) change between PIE and other modes of play, which led to other unrelated issues.
I packaged my multiplayer game. the game opens, I open it on 2 different computers and I set up a server on one of them but the server shows 9.999 ms so it breaks when joining
ty
my English is not enough to understand, can you help me understand how to solve the problem?
I tried to have chat gpty summarize it, but it tells me how to prevent high ping servers from being listed in the list, not how to prevent the server from showing ping at a level it should not be.
@swift sorrel @upbeat basin I think I’m going to try moving the Widget creation for the health bar to the Player Controller tonight instead, and see if that gives me better results.
It’s currently stored on the player character.
What do you think about that? Or is there a better place to create and store it?
Hey, got a design question related to replicated plugins. Whats the correct approach when designing a multiplayer ready plugin? Should the player provide his own rpcs or should the plugin have everything setup already? Should the user have to implement his own rpc calls on the server or should he have some readily available rpcs already in the plugin?
Or would the player state be a better place for this?
If it should only be shown to the client that needs to see it, then yes, it's preferred to put it in the controller.
if everyone needs to see it, you can leave it in the character or move it to the player state while replicating it
The plugin should handle it if it claims to support multiplayer.
Otherwise, it doesn't support multiplayer.
can you use a rep notify in a packed level actor bp ?
specifically to remove a hism instance by index and replicate that
i chalked it up to a no, given that the exact same logic with hism's works but for some reason in the PLA it does not
Whwat's doing your movement?
it's movementing
I mean did you modify CMC, is it your own system, what is it
If I wanted to replicate it in the future, like for example showing all players health on a screen in the ship, then I should put it in the player state now?
It's my own system for walking on custom nav meshes
Hi everyone.
Is it safe to set my replicated variable inside of ConstructionScript?
Especially if it is pre-placed actor on level.
Is the variable I set gonna be replicated this way?
Afaik they dont run on clients.
You could still set replicated variables in the server and they'd get replicated at runtime after construction, but it wouldn't be reliable
Hi, I am having some troubles with the GetCurrentPlayers Node, every other node works here in the screenshot, only GetCurrentPlayers returns 1 always.
Does someone ever had a similar problem?
is it ok to have a timer - with quick interval time of 0.2s - running on server?
Can I do a net multicast from the server instance of GameState? It's acting like I can't, but that seems odd
Yeah, why not?
Should be able to, show code?
@upbeat basin @swift sorrel I havent changed any of the code, or moved the health to the player controller or player state yet, BUT I did package my game, and I wanted to see the error I got from the logs and wanted to share with yall! Will work on it more tomorrow.
has anyone made anything using the resimulation stuff in 5.5? please share I would like to see how ready it is
and can it be setup through blueprints only?
I am testing Subsystem on 5.5 and it is not able to join the session although it found it. Here is my code. Does anyone have any idea? I used the similar structure, but now it is not working here and it returnsEOnJoinSessionCompleteResult::UnknownError
// MultiplayerSessionsSubsystem.h
#pragma once
#include "CoreMinimal.h"
#include "Subsystems/GameInstanceSubsystem.h"
#include "Interfaces/OnlineSessionInterface.h"
#include "Online/OnlineSessionNames.h"
#include "MultiplayerSessionsSubsystem.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FServerCreateDelegate, bool, WasSuccessful);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FServerJoinDelegate, bool, WasSuccessful);
UCLASS()
class MYPROJECT_API UMultiplayerSessionsSubsystem : public UGameInstanceSubsystem
{
GENERATED_BODY()
public:
UMultiplayerSessionsSubsystem();
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
virtual void Deinitialize() override;
IOnlineSessionPtr SessionInterface;
// Changed to no parameters – the server name is now fixed as "ServerTestName"
UFUNCTION(BlueprintCallable)
void CreateServer();
UFUNCTION(BlueprintCallable)
void FindServer();
void OnCreateSessionComplete(FName SessionName, bool WasSuccessful);
void OnDestroySessionComplete(FName SessionName, bool WasSuccessful);
void OnFindSessionsComplete(bool WasSuccessful);
void OnJoinSessionComplete(FName SessionName, EOnJoinSessionCompleteResult::Type Result);
bool CreateServerAfterDestroy;
FString DestroyServerName;
FString ServerNameToFind;
FName MySessionName;
TSharedPtr<FOnlineSessionSearch> SessionSearch;
UPROPERTY(BlueprintAssignable)
FServerCreateDelegate ServerCreateDel;
UPROPERTY(BlueprintAssignable)
FServerJoinDelegate ServerJoinDel;
// This property can now be ignored if you always want the new map
UPROPERTY(BlueprintReadWrite)
FString GameMapPath;
};
I packaged my multiplayer game. the game opens, I open it on 2 different computers and I set up a server on one of them but the server shows 9.999 ms so it breaks when joining.
Ih ave pretty good connection and both pc connected same internet
if you have 9999 ms in the lobby then that really got nothing to do with the actual ping.
you are most likely using Steam
and at least in the old one, the Ping is not implemented for listen server
9999 is just the hardcoded values
guys, I have an Actor. And it has let's say some variable. Based on the value of this variable change something happens on the client after this variable replication. Like a sound play. Let's say it's a door. I'm struggling to understand what is the best way to determine if it's initial Actor initialization or it was later affected by player action. The problem I'm solving is how to make my doors not making sounds when I load new level 🙂
many implementation imo, just a matter of choosing which one you want to implement.
like you can track the current animation position.
and / or you can also track if the door have fully closed / open
check if it's locked/unlocked and play relevant sound. but I can't distinguish if it was initial values replication 🙂
Probably want to wrap any info you need with a struct.
maybe you PostInitializeProperties..
hmmm
I mean what's the issue right now?
maybe before you play / close the door, you wait for the server to tell you where exactly the door should be
and play anim based on the info
server sets where the door should be, based on the configuration. it gets replicated to client and produces sound
I would just play the sound in the animation
I don't want it to produce sound unless the action was iniated by player
or if you are using timeline, you can do that too
why not just make the sound play when the door is at 25% of the anim
kinda like anim notify
ohh
so On interact?
it will make it a bit more ugly :/
I still can't visualize the problem
if you want the sound to just play when the action is intiiated by the player then do just that
e.g. when the character is interacting with the chest
well, it's not easy. there're also simulated proxies that needs to hear it
so I stick to replication
I was hoping to avoid multicast. It all works perfectly now, but the only issue is when the map loads 🙂
Why do you want to avoid multicast
it has it's usses
as long they are used as they are intended
and that's the issue with Repnotify, you are playing the sound based on the boolean value
it's a perfect use case of multicast?
if they are dropped, that's cool?
that way, players that just join the map doesn't need to hear the sound on every chest that is unlocked
UPROPERTY(ReplicatedUsing=OnRep_IsActive)
bool bIsActive = true;
TOptional<bool> bIsActiveOld;
I solved it like this in one case
I just thought that maybe there's another way to do it
it's shame that OnRep won't give you previous value
They do!
add a param on your repnotify function
yes
omg
void OnRep_IsActive(bool bOldValue)
... although for a bool you know what the old value was
So it's unnecessary
If you mean for initial replication
yep, I only need it for initial
I'm voting for multicast here though
wow, that looks very tricky
interesting
I don't like this multicast, since I anyway need to replicate this value to client
why do I need to do additonal multicast when I can avoid it?
additional?
If you're replicating the value already then yeah, just use the on rep
it seems weird that you are tying the logic of a one off cosmetic action in the OnRep instead of just playing the sound with MC on interaction
yeah
and you play the sound when you are interacting with the door
anyway just my 2 cents.
seems like a perfect use case of multicast
I will just go crazy and make GameplayAbility out of it 🙂
actually it's not a bad idea.. xD
my approach would be, if door / chest have animation. Play Locally on Anim Notify or Timeline
if no animation, then just multicast on interaction
maybe you're right..
UPROPERTY(ReplicatedUsing=OnRep_IsActivatedUpdatedEvent, EditDefaultsOnly, BlueprintReadOnly,
meta = (AllowPrivateAccess = true))
bool bIsActivated = false;
UFUNCTION(BlueprintNativeEvent)
void OnRep_IsActivatedUpdatedEvent();
I wonder why CPP version won't be called :/
it calls blueprint implementation, but not CPP one
If you're replicating the door movement, and the door moving plays a sound, you don't need to play a multicast
The door movement is stateful, you shouldn't use RPCs for that
Agree, he was saying he doesn't have animation for his usecase.
In the Blueprint, make sure to right click the overridden function and select "Add call to parent function"
oh!
Instead OnRep-> bUnlocked? If True Play Open sound else Play Close Sound
That will just play sound regardless if the chest being interacted or not. Need extra param or maybe just Multicast on Interaction if there's no animation.
If you have animation anyway, then play sound locally no rpc needed.
for some reason now it works with TOptional<bool> being set in BeginPlay. but I think it's random
OnReps can arrive later then begin play for sure
but one of my pc cant join game. it can see the server on list but cant join
Using steam?
yes
and what's the code to travel to the server?
does it print failed?
no
its ok now?
and do I need to put a question mark at the beginning, I didn't when I create it.
You don't need to call open level after join session
By doing it you'd disconnect and open up a local level
Join session loads the server map by itself
Try adding ? Before listen when creating the session.
Not sure if that matters.
But yea don't open level after join session.
then what I need to do
When you call "JoinSession" you don't have to do anything. The C++ code behind that does the Travel to the Server for you.
OpenLevel is only needed for hosting (with the ?listen option) and potentially for disconnecting by traveling back to the MainMenu level or similar.
And of course generally to change levels in Singleplayer Games.
then why second pc can see server but cant join it
try turning off the firewall
might be blocking connection
Also check ''Use LAN'' on create session if you're trying to connect in the same network
Hi, I’ve started learning networking in UE5, and I have a question. What is EOnlineDataAdvertisementType, and how does it work? I think I understand it, but I want to be sure. Could you explain every detail? Thanks in advance! 🙂
I need to connect with some other pc's connected other internets
Yes, I have exactly the same problem. when a player joins the server, it just doesn't load the map. i've searched all over the internet and can't find a solution
I don't share the issue
I take it, you guys using space war?
Well if you can see the other person's session then you would have set up the appid
no, i have my own appid. but when for some reason when i connect to a session, the game logs “Browse: steam.76561199496937360/Game/menu” it tries to load the map it is on. does this mean that the server just doesn't send the right map to the players?
No idea, I can travel just fine with friends only with join session.
It should travel to the map the server hosted with ?listen as the arg
After migrating my project from 5.3 to 5.5, my multiplayer system failed to join sessions. So, I tried to use the Advanced Steam Sessions Plugin. But it is not working. I am following a tutorial on YouTube, which is quite simple and popular, but it still does not work. Does Anyone know any documentation or resources to learn more about it?
Anyone bein able to fix the issue of failing to join session on 5.5?
Its more than a week that I am dealing with these issues I would appreciate any help
I have this. i've been trying to find solutions for 4 months now, but there is no one who knows ue5 well enough to help me with it
I don't know what to do or how to solve this problem
Great, epic games seems to be really acitve solving bugs!!
Did you try to use Advanced Steam Session Plugin?
yes. the whole time
so you are telling me Advanced Steam Seesion used to work on your project and now that you are on 5.5 it is not working anymore?
No, it didn't work before lol
I'm using ue5.3
oww, on 5.3 there are not any issue you can use other methods also
it doesn't work for me and no one can help me with it..... I don't think it has anything to do with the advanced session
There is a course on gamedev.tv
by khan alpar or something. use it and it will solve your issue
I test it on 5.3 and it works fine
What does your defaultengine.ini look like? in the line "
; If using Sessions
; bInitServerOnClient=true" there are these characters at the beginning and a comment at the top. should they be removed?
I will send it
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Steam
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
; If using Sessions
bInitServerOnClient=true
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
Here are my network related settings
Hmm. Now I have another problem. now when connecting to the server in the logs writes “SteamSockets: Could not determine the binding address!” and “SteamSockets: Cannot get information on an invalid socket handle, returning null” and “TravelFailure: PendingNetGameCreateFailure, Reason for Failure: ‘Error initializing network layer.’” any ideas?
What is your steam socket setting in the ini file?
[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/SteamSockets.SteamSocketsNetDriver",DriverClassNameFallback="/Script/SteamSockets.SteamNetSocketsNetDriver")
[Voice]
bEnabled=true
[OnlineSubsystem]
DefaultPlatformService="Steam"
bHasVoiceEnabled=true
bAllowP2PPacketRelay=true
bUseSteamNetworking=true
bUseBuildIdOVerride=true
BuildIdOverride=1
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=[my steamid]
SteamAppId=[my steamid]
GameServerQueryPort=27015
bRelaunchInSteam=false
bUseSteamNetworking=true ;alterado
GameVersion=1.0.0.0
bVACEnabled=1
bAllowP2PPacketRelay=true ;alterado
P2PConnectionTimeout=180
bUseLobbiesIfAvailable = false ;alterado
bInitServerOnClient=false
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
[Core.Log]
LogOnline=All
LogOnlineGame=All
that all i have
@fickle lichen @subtle cliff Both of you would need to do some more extensive debugging tbh.
- If you have working versions then compare them to the ones that don't work.
- Especially Log-wise.
- Make sure to enable any important Log Categories with VeryVerbose logging. LogOnline and LogOnlineGame are probably not enough.
- Make sure the projects are packaging the maps correctly, especially if you have different packaging settings for Server and Client.
- Attach Rider/VS to your Client and breakpoint the parts in C++ where it would try to travel. See why it doesn't give you the map it should travel to.
Does declaring a variable as replicated comes with actual overhead if the value never changes?
I take it, the server only send data if the value changes?
or do they constantly get send every NetUpdate regardless if the value changes or not?
yea pretty sure it only sends data thats changed, so there would be a tiny overhead from it checking to see if it changed
Check RepLayout.h:1069
has a nice long comment about how it works
- When we want to replicate properties for an object, merge together any outstanding changelists
- and then iterate over it using Layout Commands that serialize the necessary property data.
- @FSendingRepState maintains a circular buffer that tracks recently sent Changelists (@FRepChangedHistory).
- These history items track the Changelist alongside the Packet ID that the bunches were sent in.
- Once we receive ACKs for all associated packets, the history will be removed from the buffer.
- If NAKs are received for any of the packets, we will merge the changelist into the next set of properties we replicate.
Also handles clients saying they haven't received some packets. Will re-send the missing changes on the next replication.
Or well - will send the latest version of the properties that got missed
👍 👍 👍 👍 👍
when I try to join the listen server multiplayer game from a second computer, it cannot join. I turned off firewall.
Any logs?
where can i access the logs of the packaged game. when i was in the editor it was connecting without any problem
Your packaged project should have a Saved/Logs folder.
But you need to either package non-shipping, or enable shipping logs via Source Build.
my ability is not being activating on gas
on client
but is activated on server
using press input id
class UInputComponent* InputComponent)
{
if (!InputComponent)
{
UE_LOG(LogTemp, Error, TEXT("USI_AbilitySystemComponent::BindInputActions - InputComponent is NULL!"));
return;
}
if (!InputData)
{
UE_LOG(LogTemp, Warning, TEXT("USI_AbilitySystemComponent::BindInputActions - No InputDatas provided!"));
return;
}
if (ISI_InputComponentInterface* InputInterface = Cast<ISI_InputComponentInterface>(InputComponent))
{
UE_LOG(LogTemp, Log, TEXT("USI_AbilitySystemComponent::BindInputActions - Successfully cast InputComponent to ISI_InputComponentInterface."));
InputInterface->BindInputAbilities(InputData, this);
}
else
{
UE_LOG(LogTemp, Error, TEXT("USI_AbilitySystemComponent::BindInputActions - InputComponent does NOT implement ISI_InputComponentInterface!"));
}
}
is there any good guids on how to make servers into your game?
{
//Client-specific functionality
if (IsLocallyControlled())
{
FString healthMessage = FString::Printf(TEXT("You now have %f health remaining."), CurrentHealth);
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, healthMessage);
if (CurrentHealth <= 0)
{
FString deathMessage = FString::Printf(TEXT("You have been killed."));
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, deathMessage);
}
}
//Server-specific functionality
if (GetLocalRole() == ROLE_Authority)
{
FString healthMessage = FString::Printf(TEXT("%s now has %f health remaining."), *GetFName().ToString(), CurrentHealth);
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, healthMessage);
}
//Functions that occur on all machines.
/*
Any special functionality that should occur as a result of damage or death should be placed here.
*/
}
why DebugMessages show on both client and server(listen server)
https://dev.epicgames.com/documentation/en-us/unreal-engine/multiplayer-programming-quick-start-for-unreal-engine#7testyourgame
Uncheck "run under one process" in settings
omg it works ,think you
By the way, are there any good Unreal C++ multiplayer game tutorials? The official tutorial is too short
The same way you do local, but instead of a local ip you enter the public ip and port
Or you can also use an online subsystem like Steam
Stephen ulbardi multiplayer c++ shooter
Imo
Rest is from pinned material on this channel and articles from Alvarez and on the net.
I got logs from client side pc and server side pc. I can send it private or do you want me to send it here?
Hello
We are implementing Steamworks SDK into our multiplayer game. We currently need to test the Lobby Creation and Joining functionality.
Is there really no way of testing this, other than with 2 different devices, and packaging the game over and over whenever a bug happens and we fix it?
Can this be tested on 1 PC, and without packaging the game?
You can't use one PC to test Steam
Is there anyone who knows how to create a replicated stamina system in the most efficient way?
For characters/cmc?
For playable char
Then yep. But let me push a temp branch for you with updated unreleased version
https://github.com/Vaei/PredictedMovement/blob/tmp-stam/Source/PredictedMovement/Public/Stamina/StaminaMovement.h
https://github.com/Vaei/PredictedMovement/blob/tmp-stam/Source/PredictedMovement/Private/Stamina/StaminaMovement.cpp
The PredictedMovement repo in general may be worthwhile to you, version 2.0.0 is nearly finished and includes movement modifiers with varying levels (e.g. snare level 1-5, boost, slow fall, etc.)
https://github.com/Vaei/PredictedMovement/
Okay, I'll try it. Does it work with Blueprints? I don't know C++.
Version 2.0.0 will have a blueprint friendly version that you can use in your BP project
But the current version, no, not really
It isn't possible to implement anything in CMC in BP, you can't make a functional stamina system with BP (its literally not possible, you will de-sync considerably even in the best case scenario)
If you want, I can make a note to ping you here when its released
Can a client see the owner of the actors they own?
There is an actor, I am calling SetOwner on it from the server
With print string I have confirmed that it sets correctly
But then, when on the client, that was set as owner, I try to get owner of that actor, it is not valid, doesn't exist
That actor is Replicating, and always relevant.
An Owner of an Actor can be any other Actor, there are no rules around what can/cannot be an Owner.
If you set the Owner of an Actor to another Actor that is not Network Relevant to a viewing Client, it will therefore be empty.
The owner is a player controller
You may need to brush up on your understanding of what the network relevancy is of the different core gameplay classes are.
PlayerController is only relevant to the Server and the Client that owns the PlayerController.
Other Clients never know about other Clients PlayerControllers.
Therefore, if you use the PlayerController as the Owner for the Actor, other Clients will see that Actor as having no Owner.
Correct, but shouldn't the owner client of that player controller, see the owner, meaning themselves?
It should yes.
The PlayerState is a good example of this
The PlayerStates Owner is the PlayerController it belongs to.
This will be empty for Simulated Proxy PlayerStates.
okey thanks
Then I am back to banging my head on the wall wondering what am I doing wrong. May I ask for your help further, with specific examples? And if yes, should I do it here or DM?
Always ask questions you have within the server unless you are invited by someone to continue in DMs.
Sure, thanks. Long explanation because I am giving all the relevant details.
The game is a 1v1 card game. Listen Server. So one player is listen server, the other is the client.
I have an actor called CardHand. It basically handles the logic of cards transforms.
And I have an actor called Card. Self explanatory) It is the card.
I want to make it, so that each player sees their own cards, but doesn't see the other player's cards.
Inside CardHand, I have an array called "RevealedCards". Any cards in this array, on tick have their orientation set to upwards (so player can see them). Cards not in this array, on tick are set to downwards.
CardHand - Replicated, Always Relevant
Card - Replicated, Always Relevant
Other options, such as movement replication are not ticked. Variables in those actors are Not replicated too.
On Server (I know this because I do an IsServer check before doing), I set the owner of each CardHand to their respective players. Checked with print string, the owners are being set correctly.
When a Card is added (from a server) to CardHand, I set the owner of that card, to the CardHand.
Then here's the logic I try to reveal the card only to their owning player:
When CardHand receives a card, it calls an Owning Client RPC.
The OwningClient RPC, adds the card to "RevealedCards" array. Then it checks if IsServer, it calls a Multicast RPC.
The Multicast RPC checks if Not Server, Removes the card from RevealedCards array.
Where are things going wrong here?
The tick of CardHand, that handles the transforms, is being performed everywhere. So it's basically just a Tick, without any authority checks.
So the issue is that the cards wont reveal to the opponent?
Listen Server's Card is revealed (for both the server and the client), the client's card is hidden, again for both.
From what you are telling me, the Client is sending a Client RPC?
This would be wrong, the Client would need to send a Server RPC, to tell the Server "hey, reveal that card".
Ah the multicast part?
CardHand Receives a card. The receiving is done on Server.
When Received, it calls an OwningClient RPC. So the server calls an OwningClient RPC.
The OwningClient RPC Reveales the card.
Multicasts can only be called by the Server
The multicast part is wrong I guess, let me try fixing it, but it doesn't explain why one of the cards is hidden for both.
Personally how you are doing this is just wrong in general.
How should I? This was the only logic I could come up with, since one of the clients is also the server (listen server).
I would a RepNotify Bool to handle the "reveal card" part.
On the Card itself
The Card itself should be handling its own visibility
The CardHand is ok, it would be responsible for just saying what Cards a Player owns.
Okay, so a RepNotify Bool on the card, set that bool from the server?
I am struggling with the part to show each player their own card, but hide the other player's
When creating a Card, set its Owner to the PlayerState, there are very few reasons you would want to use a PlayerController.
You would also want something like a bRevealedToOpponent RepNotify Bool on the Card.
This would be false by default
In BeginPlay you would check if the Owner (which would be the PlayerState) is the same as the Local Player.
If thats true, then you show the card, because its the owners card.
The OnRep_bRevealedToOpponent would handle showing it for the opponent.
The Server would set bRevealedToOpponent to true when the card needs to be shown to the Opponent.
Replication of that variable would trigger the reveal.
With this setup it doesnt matter if its a Listen Server host or a Client
Bit of a wonky drawing but this should show you what the flow would be.
If the Server (Host) wants to reveal a Card, they just set bRevealToOpponent to True and it will replicate that to the Client.
If the Client wants to reveal a Card, they must first RPC to the Server, then the Server sets bRevealToOpponent to True and (because of how OnReps work in BP for Servers) it will execute that same reveal logic.
Will try this, Thanks!
This might be a bit clearer than the one above.
So therefore there are no Client RPCs, no Multicasts.
Its stateful, which is important for other reasons.
I suppose you could interpret the revealing of a Card as an Event, but it could also be a Stateful transition as well.
In this case, I would opt for it being Stateful, since you might want to unreveal it later for whatever reason.
That can easily be done by just setting bRevealToOpponent to False.
And it just reverses the reveal.
Maybe your game gives the opponent the ability to see your Cards for a limited period or something.
🤷
That functionality might be useful.
this diagram confused me for so long because the SERVER and CLIENT starting points are at the bottom but the BEGIN PLAY starting point is at the top
but a good idea to draw out stuff like this when state isn't making sense
Yeah I was just thinking backwards in my head when drawing it so it came out weird lol
I find it useful to think about it in that way. Start from what you want to happen and work back from there.
Arrows might have been better 😛
Hey people,
Not sure where to post it, here or in #cpp, but im generally very confused by the way replicated functions have to be implemented in c++, so pardon if the question is very basic.
I'm setting the basic functionality any character in the game will have - in a c++ class, and implementing the logic in blueprints.
Therefore im setting up Death().
As far as I understand, death has to be executed on the server and replicated to the clients, but if i set it to be UFUNCTION(Server) then i cannot have it as UFUNCTION(Server, BlueprintNativeEvent) - but i want to handle death in the blueprints...
The best i've come up with claude is having Death() and OnDeath(), but im confused how to continue - how do I override OnDeath()?
You override it in the Blueprint? Not sure what part about that is an issue?
Also you should not be providing the declaration for the _Implementation functions.
The UHT generated code already does that
Am I missing a specifier? because i dont have an option to override the function and it wont fire
Did you remove the _Implementation declarations?
in the header? yes
You arent using HotReload or LiveCoding are you?
Did you close the Editor and recompile properly?
yes of course
The code looks fine, not sure why you cant see it? How are you trying to override it in BP?
well thats the issue, i dont see it in the list of functions i can override
does it have to be a function instead of an event? return a value?
No, BlueprintNativeEvent and BlueprintImplementableEvent should appear in the lsit.
Actually, because there is no return value, perhaps you might have to "implement" it by right clicking in the Graph and searching for it
There should be 2 entries, Call OnDeath and Event OnDeath or something like that
Event OnDeath would be the "implementation" override
calling the event counts as overriding it?
No
like this
i see
theres a meta specifier to force it to act as a function
If it had a return value it would be in the list and be a function instead
That might actually also make it appear in the list of overrides as well
and it should fire when i call Death() since the c++ code?
Yes
Note, that the C++ implementation wont be called
Of OnDeath
Since, in the BP implementation you havent called Super
You can do that by right clicking the node and selecting Add Call to Parent Function
thats a good thing to know
but it seems i was doing everything right, yet it wont fire 
What do you mean?
besides the _Implementation, i've set the whole thing right
it should work
I guess so? Did you run it and find out?
I've tried calling Death with debug key, even with Event PointDamage which happends on the server, cant get Event On Death to fire
Got it!
in Death I should have been calling OnDeath(); and not OnDeath_Implementation();
Thank you gent's
Also, Ive changed Death to be multicast because nothing was happening on the client.
Does it makes sense to be multicast, or I should have Death to be server only, have intermediate MulticastDeath and blueprint native OnDeath?
You can keep it as multicast, and hook up a has authority node to it for stuff that only server needs to do
Aight, thanks!
I am trying to search for servers in my game and join the game I set up on my 2nd computer but I can't join. this is a listen server steam game. both computers are connected to the same network. my internet connection is stable. I have left images of how I set it up and how I tried to join game and the logs of the server and client below. I would be grateful if you could help
by the way, it sees the server in the server list
just cant join when I click on servers wigdet
?listen for the args
as for your join logic, try to bypass the if check just to make sure you can join for now.
I have quite weird replication issue. I have a GameItem class that implements a Focus event
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Interaction")
void Focus(AActor *Caller);
Im overriding this in a bp to add a overlay material onto the game item's mesh. I'm sending a raycast from my player character into the item and when it hits, im calling the focus event on it. im using a dedicated server with 2 clients. when Client 2 hits the cube it gets the overlay material applied... but on CLIENT 1 for some reason?
From the event tick method of the CBP_SandBoxCharacter from GASP, im sending out a trace, f the trace detect a GameItem, im calling the Focus method on the Item
If thats what you mean
Im starting to think there's something up with the event tick on that particular blueprint
Any reason why is this networked? Highlighting item is normally is done for the local machine only.
Exactly, im trying to have it client side
unless it's the intention to highlight an item when some other player looking at it
Ok, why is it RPC in the first place?
why is it even networked at all
Just If Locally Controlled -> Trace -> Set Material
Focusing itself needs to be networked, but the highlight I want client side
On Tick -> If (FocusActor)-> Set Material


