#multiplayer
1 messages Β· Page 635 of 1
you don't replicate widgets, you replicate the data within them
When looking for a dedicated server host - should I prioritize RAM or CPU for the server? Or are both equally important?
typical dedi has 2 cores and don't load most assets
incredibly game dependent question
What metrics can I use to determine it?
how much do you want to spend running your game? under performing on capable hardware? use the profiling tools
Should we trust anim notifies when it comes to multiplayer? I heard they are not reliable at all
there is an optimization
which will not exec anim notifies server side unless its a listen server and the animation is on host's player screen
montages don't have the same restriction @peak sentinel
Thanks for the explanation Zlo
makes anim notifies fine for stuff like footstep sounds and such
but very bad for gameplay logic
and that was super fun to debug, monster stops doing damage to me, because damage is triggered from an anim notify, so i call a teammate that was hosting (listen server) to come over and examine the monster with a debugger
but then optimization turns off, because he came close, and monster starts doing damage normally
Are you using timers now? Or do you have any other alternative?
π awesome, thanks
for dedicated servers you still need to enable the animations to run, think by default ticking skeletons is off
because damage is triggered from an anim notify
Are you calling ApplyDamage in the notify? Curious. Or do you cast to the actor and call a function that handles it?
notify is triggered at the appropriate time during the attack animation
that causes damage to be dealt, but its not dealt directly by the notify
Im using FSavedMove to make the character wallrun
Everything works fine
but when I try to change the Z velocity it starts stuttering if the change is positive but there's no stutter if its negative
const FVector Adjusted = Velocity * deltaTime; FHitResult Hit(1.f); SafeMoveUpdatedComponent(Adjusted, UpdatedComponent->GetComponentQuat(), true, Hit);
hi, i have a replicate movement problem, when my character is moving and i attach it to an object(i use RPC to server), the client-character position is different than the server, i already tick replicate movement in character, can someone have a solution about this?
if its attached, its using the position of whatever its attached to
@winged badger but that position in server and client are different, if my character is NOT moving and i attacah to an object, the client-character position is correct
Regarding using the CMC network flags... has anyone here needed to modify the number of custom movement flags in the engine to get more than just the three you are allowed to use by default?
having three seems really limited
only way I can think of to add more would be to modify the engine source to use more
I'm talking about these:
if (SavedRequestToStartSprinting)
{
Result |= FLAG_Custom_0;
}
if (SavedRequestToStartWalking)
{
Result |= FLAG_Custom_1;
}
if (bSavedWantsDodge)
{
Result |= FLAG_Custom_2;
}
Has anyone here needed to use say, FLAG_Custom_5 for example?
u have to learn how to send custom data
one sec
look at my plugin
Smooth Networkjed Movement
as it shows off how to do that
its free btw
Don't multi post please
can I use network flags to make sure an integer is updated on the the client and server ?
basically instead of sending a bool/uint8 I want to send an integer
how i can play RootMotion animationMontage in multiplayer?
@eternal canyon Ok thanks! I will definitely check that out
Doesn't the CMC just handle that automagically?
u can or u could also send custom data
either way woudl prb work
@dark edge idk, i think i skip some settings
I have a simple physics ball that's set to replicate. But when someone pushes it, the movement/ball aren't replicated. Is there a reason?
You got replicate physics turned on? It'll be an option for the component.
@dark edge "Replicate Physics to Autonomous Proxy" is on, but nothing else
You should also have replicate movement on right
Yep yep, thats on too. I also have "replicate component" on as well
My game lags like it's hosted in hell by satan himself, is that normal with 4 people on lan and a pretty good internet provider?
Are there any beginner mistakes that cause lag or any tips how to fix it?
For example sometimes RPCs just got to nirvana and no one hears from them ever again.. Is there any way to set an RPC to "must be received by any means"?
Yeah, that's "Reliable"
It's also a good way to cause lag
As to game lagging, it's impossible to answer why - depends on what happens, who's hosting, what's the ping like
Usually the answer is "terrible multiplayer code"
Ohh thanks, ill try that out
What are you rpcing on tick?
what about the host/players region if its a listen server ?
I just have like 5 replicated variables and about 1 rpc per second per player when doing something..?
it's all on my lan
That doesn't say anything about the quality of the netcode
Nothing at all, i thought that's nothing you should do..
By lagging do you mean the movement is jittery? Or are things that are not related to movement lagging?
You might be fighting the CMC
Games don't "lag" because they
- assume they'll get no network update for up to one second, and keep working smoothly in that very common case
- assume that server & client will disagree
- avoid sending or receiving unneeded data (minimize your data)
- accept that data will be lost (most RPC traffic should be unreliable)
- have a fast server
So check that stuff
maybe you should run the network profiler and post a screenshot right?
https://docs.unrealengine.com/en-US/InteractiveExperiences/Networking/NetworkProfiler/index.html
No the movement works, just things don't happen anymore
Here's my advice : log everything on clients and server, dump data, make graphs, investigate thoroughly
It's okay for multiplayer features to take 5x the time they take in singleplayer
Multiplayer is hard, so take it slow and careful
ill try that thanks
Also might it be because it's on LAN? Will it run better via steam?
if it does not work on LAN it won't be better on steam
with steam you also have larger ping times
Also additional advice ; set your lag to 100ms with 50 variance in engine.ini, and never take it off
You want to develop with large ping
^
people never test with ping
and wonder why they end up with replication race issues
or weird shit happening
"Is it normal that I get one second worth of client RPCs at once after no data for two seconds ?"
Yes
Networks suck
One thing you can never fix, Ping Time and lost packets. All you can do is minimize and handle things gracefully.
if you send 20 reliable RPC's to a player in a short time, but they are having slight networking difficulties, you will boot them from the game. (which is why reliable RPC's on tick is not allowed). You will fill that reliable buffer.
i have seen many people abuse reliable RPC's
I get that, it sounds like honey to my ears..
My pawn is getting stuck in the air when it gets spawned in.
Im trying to spawn it through the game mode btw
So to find the things i need to fix i tried to create an artificial lag generator... but everything still works like that's nothing π π
why are you doing multicast
from a local client input..
and every .01 seconds!
that is not a lag generator that is just wrong π
why not use the engines built in stuff ? π
Lag != sending tons of RPCs
is that a console command?
net pktlag=100
yeah i see π did that out of frustration
You can also configure it in the project settings under Level Editor > Play > Multiplayer Options > Network Emulation
i normally rock this for testing
Hmm, with packet loss, can a replicated variable just not get updated until it changes again?
Ah ok, so worst case you might miss an in-between value
I.e., if you update a value from 1 to 2, then from 2 to 3, a client might get 1 to 3
yes
Good to know, thanks
Unreliable RPCs. But reliable ones are much more costly
How did hl1 multiplayer even work whit those older internet connections if i canβt even make a game lagfree in 2021..
How do you "dump" the data?
I remember Stranger mentioned some Python tricks once, I dont know any other way than UE's profiler tools
Wondering how he does
@meager spade Oh wow, just checked out Ironward Studios from your signature - why have I never heard of Red Solstice before now?! My friends loved the hell out of games like Alien Swarm. Heck I'm making a 3rd person coop alien shooter as a hobby project inspired by it.
Do you do anything special to handle hordes of AI or is it simply an AI controller with a Pawn for each?
Don't tell me it's a roguelike
No, more like world war z, but militaristic scifi
We're working on a roguelike coop top down shooter
But it's a hobby project, might not ever finish/publish
Anyone ever made a bo zombies type game?
Turn based or real time?
Real-time. Sorta like a top down risk of rain but with the gear and slow pace of XCOM
Is there something like an βevent player joined/left sessionβ? Canβt find anything..
To inform other players if someone joined or left
GameMode -> OnPostLogin / OnLogOut
Ah thanks
Well I love me some X-COM. Have a steam page or website yet?
does your plugin include sending custom data ? [Edit] Just realized it does
We got the Steam page parked but nothing public yet. Still architecting. Also our indev name got used by another game so we're just StudioNameGame right now.
Similar to our game adriel
I have a bit of an odd question that is about multiplayer, but goes against one of the main best practices of Multiplayer. Is there a reasonable way to distribute a processing task between the clients? I am using a Boid system for the enemies in the game, a large task, especially with many of them, so sharing the load could be good. And as this is a Co-op game with the main way to play is to invite your friends to your game so I feel hacking of how the enemies move is less of a problem. For example If you invite your friend to your game, and they altered the distributed functions and ruin your fun, I think that is between you and the friend you invited.
you'd need to send all that stuff you can't process over the network
and results back
so, not even remotely
not even on LAN i think
My general thought was the host would deem that particular enemies need an updated list of those around them, divides up the list of references and sends them to the clients. the client finds those nearby and sends them back.
All the calculations are on the enemies Position, Orientation, and movement direction. Things that are sent to the Clients anyway. So I would think the server just sending a request to the client to perform a computation and send back the result should be possible
It may not be as precise as if only the server did it, as the positions of the Boids are constantly changing and the clients will never be 100% acurate to the server, But the entire system is imprecise and chaotic
I feel I can make this work, I have several optimizations I have not mentioned, I am just struggling with finding a way sending separate data to each client.
Going through all the player controllers on the server and sending them each a client RPC would allow you to send different data to each client. But yeah, that does sound like it'll kill your bandwidth quickly. Heck, I'd be interested to know if replicating the movement of many AI actors alone wouldn't already kill bandwidth without some tricks.
Did you already try multithreading the boids calculations? CPU power is a lot cheaper than bandwidth I'd reckon
... i need help im stuck on destroy actor for past 2h
item on server is gone but on all clients is still in place
yes is set replicate
spawn/destroy
If an actor is replicated, spawning and destroying it on the server should already replicate to the clients
but if i do RPC on server then is only on server, idk what is going on
if the game mode is server only and the clients never see it, should I be checking to see if a player is in VR or PC mode in there to respawn them?
Make sure that it's replicated then.
Also, having an RPC that allows any client to spawn anything sounds like a good way for exploits, if you're even the slightest bit worried about cheating
Now you're just checking if the server is running in VR or not. Probably something you want to keep on your player controller or player state and let the client send an RPC to the server to let it know if a headset is connected
multiplayer is for co op π
i don't care about exploits
middle is server
spawn server only
does switch has autority work in the game mode file?
why would you need that?
Not really, because the game mode only exists on the server it'll always be true
@halcyon totem check if is sever and if is running VR
in the GameMode?
GameMode is server only...
client needs to tell the server if it has a headset
via a RPC from the PlayerController.
ah ok this might be the reason everyone spawns as what ever the server is.
so if the server is a VR everyone respawns as VR after words
lol o forgotten how multiplayer works π
and my item data was empty was not displaying items (try delete empty invisible clone and and not right visible clone)
Yeah, as mentioned, that's definitely the case
after refactoring 85% of inventory and item System I don't think a bit
@craggy void thanks for trying to help
Yeah that still sounds off. Spawning and destroying on server should be enough if the actor is replicated.
You'll get far more mileage out of making the sim more efficient on server.
Are you already doing it in C++ in a cache-friendly manner?
You could eliminate the server to client RPC by just having the client send it on their controller's beginplay or something.
The name Replicated_PlayerController sounds like something might be off though; don't replicate player controllers
but in the game mode, where I use the boolean it to check to see if the headmount display is on, it still only spawns what ever the server is, is this what you meant by doing it in the player controller?
Are you checking that client's/controller's bool?
Hi guys,
I want to create the HUD after character possessed, someone suggested me to create the HUD in AcknowledgePossession but i can't find it in PlayerControler Blueprint, any idea?
Hello. I need some clarification about Net Dormancy and RPCs. Does dormancy influence RPCs? If I put actor to Dormant All will RPCs be called with in actor?
Presumably it will wake the actor from dormancy and attempt to send it.
And in the case of a reliable, keep the channel open until the RPC is validated.
@vivid prawn As far as I'm aware, there are no good Blueprint ways to handle this in a clean event driven approach. You'll either need to create some BIEs for this, or just do something simple in blueprint like set up a function that checks the local player controller's controlled pawn on tick. Since it starts null, it'll fire the first time it ticks that the controller has a controlled pawn. So you GetPlayerPawn0, cache that into a local pointer in the actor like AHUD, then on tick check if cached pointer != GetPlayerPawn0. If true, set the cached pointer, and call the binding. Then whatever you need can bind to that to update if the locally controlled pawn changes.
I have a weird issue. I'm using Standalone Game to launch 4 clients. However, my gamepad seems to feed inputs to all Standalone Game windows. Is there any way to only control the Standalone Game window I currently have focused?
@kindred widget i see.. okay, currently i was setting delay for 0.5 second before creating a HUD, which event happen on client side
I'm trying to reduce the delay and make things proper way
but putting it in tick is pretty much doing the same thing no?
I found a comment that user suggested me to use AcknowledgePossession since only happen when client is confirmed possessed, though UE documentation didn't say that
but i'm rarely write c++, so i'm giving it a shoot
Not really. Your delay will run 0.5 seconds after the execution line is ran. If you're doing this at beginplay, it runs 0.5 seconds after beginplay and the end. This will be a problem if you end up with a lag spike of some kind, long load maybe. Anything that causes the data you need to still be invalid efter 0.5 seconds.
If you're going blueprint only, I'd recommend the tick check and cached point that calls an event dispatcher binding. If you put it in the AHUD class, it'll only run on player clients or the listenserver, and will work for every player equally. Then you can just let anything you want do GetPlayerController0->GetHud->CastToYourHudClass->BindEventToOnLocalPawnChanged
Then that event simply gets ran whenever the local player's pawn possession changes.
Since that pointer should be replicated by default in the controller and GetPlayerPawn would update that.
It's probably the most solid blueprint only solution. Barring that, if you do C++. If your AcknowledgePossession function fires correctly. All you need to do is make a C++ subclass of whereever that is, override it, and then make a UFUNCTION(BlueprintImplementableEvent) void BPAcknowledgePossession();, then call BPAcknowledgePossession in the AcknowledgePossession override.
Yeah. Here. If you subclass the PlayerController. In your own, all you should need to do is do
.h
virtual void APlayerController::AcknowledgePossession(APawn* P) override;
UFUNCTION(BlueprintImplementableEvent) void BPAcknowledgePossession();
.cpp
void APlayerController::AcknowledgePossession(APawn* P)
{
Super::AcknowledgePossession(P);
BPAcknowledgePossession();
}
Could probably add the pawn as a parameter in the BIE. But assuming that event is called on clients when their newly possessed pawn is ready, should work fine.
the compile was successful but BPAcknowledgePossession doesn't seems to appear in blueprint when i search for it
You have a BP subclass for the C++ subclass of your player controller?
yup
You should see it in the functions override list at least.
i change the parent
Check here.
Oh. Right. Don't HotCompile. π
Turn on livecoding to be safe.
And if you change stuff in .h files, or the class constructors, always just close the editor and recompile, then open unreal.
yeah, that's the thing βπ½ that always i stay away from c++ π
after 2-3 times compiling, UE crashes and always i have to reopen the project
Never compile with editor open
You should generally just close the editor to compile pretty much most all times. It's the cleanest way. But under any circumstances, do not compile with the editor open if you're not using Livecoding.
(Unless you know what you're doing)
At best, your stuff won't work. At worse. You'll be fixing weeks worth of broken blueprints in places you didn't know you had blueprints.
i see... okay, thanks for the advice/tips
is there a way to drastically increase the bandwith use for unreal engine ?
If you're at the limits, you can increase them, though "bandwidth" is a bit general
There are some editor failsafes that are pretty low by default. Specially if you're not on 4.26
I'm on 4.25, so where could I change these limits ?
Sec.
Drop these lines into your project's Config/DefaultEngine.ini file
[/Script/Engine.Player]
ConfiguredInternetSpeed=1000000
ConfiguredLanSpeed=1000000
[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=1000000
MaxInternetClientRate=1000000
You can lower them later. Should be one megabit per second. Which is drastic overkill.
Well, it is LAN only, so should be fine.
The default in <4.26 is like 10000. π
Editor too. Should be project wide.
ok, thx a lot, I'll try it now
All this setting is, is an artificial block. The engine just won't send more data past that until it's limit is reached. For instance if you have that at 10,000 bits per second, and you send 100,000. The 100,000 will all be sent, but you won't be able to send anything else for 10 seconds.
oh, ok, good to know
is there any way for the server to send NetMulticast RPC to everyone, except the client who owns the Actor?
you could do a multicast and check whether you are the owning client ?
that's what I do, but seems a shame to waste the bandwidth when I know the client will only ignore it
maybe skipOwner ? But I think this is only for replicated values.
yeah that's just replication not rpc
Good morning. I have a general question about Steam multiplayer.
What are the downsides of using App Id 480? At what point in development is it time to get one's own App Id?
Any advice on this would be appreciated.
Cheers.
if you can afford a 100$ hit, right away
Yeah, the money is not a big obstacle.
That's a different process then the whole "Add non-Steam game to library..." bit?
I'd like to test with a friend on the other side of the continent soon, and I was thinking maybe it would be nice to have my own Id. That's why I'm asking.
Session searching can be a royal pain in the ass with 480.
i would personally get it
Now, what if I don't have a company yet? Can I register as an individual and then switch to being a company closer to release? Or would that mean having to pay the fee twice?
I don't believe you can easily change to a company identity
That was my fear...
I wonder if I have to incorporate in Canada or if it would be enough to just have a business number.
well, that seems like a question for steam support
That's fair, yeah.
Does "uploading a build to Steam" as you mentioned make it easier to share builds with friends and play online with them?
Well yeah of course, since they'd get it from Steam
itch.io does that for free though
Yeah, I've been using Itch.io.
But it sounds like with my own app id, I could test entirely within Steam which does sound nice since that's the target platform.
Yes
It doesn't explicitly state that you have to pay again, but there are insinuations that you need to reapply, probably with the same ID, so they can redo the paperwork under the conditions that the entity who holds the tax responsibility for the ID changes.
I guess the only reason I haven't done it is because of the legal hoops.
May still want to harass a Steam employee about it.
Wow, thanks, Authaer. Where did you find that information?
To be fair you can run the tax form again and IIRC you can change information, I'm just not sure about the "identity" part
"Q. I changed my legal name (and banking and tax information). How do I make this change on Steamworks?"
I assume the same would be true if you went from being a personal ownership to a company.
Ah, the FAQ. A likely source. π
Well, maybe I should just register as an individual, and then I can switch over later. That way I can put off incorporating, getting a company bank account, and all that other boring stuff.
For what it's worth I skipped on Steam until the very end
Distributing through Itch and using 480 is perfectly fine, you can still use Steam, you just need it open and have an appid.txt file so that Steam detects the game
Friends, sessions still work
Do you have any regrets about that?
Hm... So @winged badger thinks it's a great convenience and you think it's not necessary... π€
I mean yeah it's convenient of course
But at the same time if you're not a real company then the incorporation costs can be real
So try to see if you can change your Steam identity later on and failing that, register later
The main reason to do Steam early is to have the store page up for wishlisting a year before release
But I can choose to keep my project hidden on Steam for as long as I like, right?
Cool... okay, that's all good advice.
Uh, can anyone here tell me what's the best way to contact Steam with these sorts of questions?
any one used Nakama Backend?
Which condition for replicate variable by uproperty can send to autonomous client and simulated proxy client? https://docs.unrealengine.com/en-US/InteractiveExperiences/Networking/Actors/Properties/Conditions/index.html
Detailed information about how to conditionally replicate Actor properties.
I cant find an option for that
@modern swift Err, isn't that just default replication?
not sure can try
By default, replication with no conditions will be sent to all clients. So either Autonomous or Simulated.
if I use ReplicatedUsing = OnRep_ , it will call function in clients? does it call in server?
Not in C++. In C++, you have to set the variable, and then call the OnRep manually. In Blueprint, OnReps automatically fire on the server. Best to make yourself a simple SetMyVar(Type InVar); function that sets it and calls your onrep for you if you use that variable often.
To clarify. In C++, it will call on clients, not on server.
ok that's what I want I only want it call in all clients, so c++ is fine for me thx
Imagine I want to spawn a projectile in a multiplayer game. Do i spawn it on the server only and wait for it to replicate. Or should I always spawn it on both the client that shot the projectile and then have the server also spawn it for everyone?
Given that I spawn it on both the client and the server, will the one client that spawned it locally end up with 2 copies of the projectile? The one he spawned locally and the one he received from the server?
depends
what ur debating is client prediction
tho client prediction on projectiles is really hard to get perfect
so usually most games (valorant, csgo etc) just use the server and wait for it to replicate, but this comes with the issue of players over 55ms of ping as their inputs may feel latent
so what games like Unreal Tournament do is that they spawn a projectile first on the client (they predict it)
and then once the server gets notified that they want to spawn
the server will spawn at the location adjusted forward depending on the owning clients ping / 2 (only need ping one way)
tho this has its own issues as u can never really have perfect client prediction
Okay thanks, I know about client side prediction. I am just confused as to where and how I should spawn something. Considering something like playing sound I am just not sure whether or not to play it locally and then just ignore if I receive the event from the server and already played it locally or if there is a better way?
Depends on the game
or if ur projectile is fast enougbh
u can just use a trace
and spawn a particle
That's semi old practice too. A lot of times projectiles aren't even spawned. A strong use case these days is doing traces from the weapon, even for projectile predictive paths. And then replicating a simple state variable like a counting integer to display firing effects. And the client does most of the hit detection itself with the server just being a verifier. It feels best on the client themselves, and it's semi accurate looking on other clients with the correct conditions replicated.
Major issue with projectiles is like mmmm pointed out. Speed. In some cases, if one client fires a shot, the server can spawn it, and destroy it so fast it never replicates to clients, and effects never get played.
so i made a 3 players multiplayer game and idk why but in game i get 20 fps
but when i stop the game i get 100 fps
Profile it
Use a profiler to figure out why it's slow
yeah in game i have 20 fps
and when i stop the game i get 100 fps
but only when i play on multiplayer
if i play single player i get 100 fps
you're not testing in PIE multiplayer by any chance?
umm
or on a single machine in general?
Is there any bandwidth difference between passing a struct by value vs by reference on an rpc?
can someone please help? I have nodes that check to see if someone is in VR mode or not. this is in the game mode, I run a debug in VR and PC and check to see, yes my branch is working how ever in a packed game, if the server is PC everyone who respawns will be PC based on the game mode branch I think my issue is the game mode is server side, so it reads the code the server is going to be either PC or VR , and it will make everyone PC or VR how can I tell the game mode to check if its a client thats vr or PC?
@jolly siren no
ty, I assumed not π
Right, that makes sense
if I am using a branch checking to see if the HDM is connected and I do this in the game mode do branch checks in the game mode only go for the server or is it checking in there for each client also??
these nodes in the game mode they are checking if VR is active but i am having issues where its ignoring the branch checks in a packed game
Game mode only exists on the server
@halcyon totem You need some way for your clients to communicate that to the server. Either make the server reliably RPC to the client and another reliable back when the server is ready, and put the client in a standby state until the server handles it's conditions and replicates. Or better yet, don't create two different pawns. Make one pawn work with both control types.
Then you don't need special conditions, or extra networking. It'll just work.
how does one check if the steamAPI is actually running for a dedicated server? From what I see I am starting to think steam isn't even used for dedicated servers built as -development
I'm interpolating the location of the skeletal mesh component of a character on clients by replicating a bool, when client A enters network relevancy range of the client's B character that is interpolating the mesh, it would start doing the interpolation from the beginning, but what if the character interpolating is already at some more advanced point of the interpolation? how would I make client A see the interpolation at the right offset/location
@kindred widget would something like this work ? I added this check in the player controller, and then in the game mode, I added it to the post login and I see it does print a string based on if its a VR or non VR
@kindred widget does this get carried over to the game mode?
if I call that variable should that be enough to let the game mode to check to see if its should spawn a VR or PC?
Hmm. Better case would be to ditch the "Has been set" and just let the execution flow. ServerAsksClientWTFItWants. ClientTellsServerWhatItWants, ServerSpawnsPawnAndPossessesItForClient.
Also, server telling client to display particular UI is going to end badly. Client should handle it's own user interface based on what has been replicated to it.
I also still advocate for potentially setting up one pawn for both control types.
I'm changing the location of the skeletal mesh of a character on clients, but if I move or rotate the character during or after changing the location of the mesh, it returns to its original place, except on the client that owns that character
Yo bois, anybody have any luck joining games via OnlineSubsystemSteam? Trying open steam.steam64id:7777 but no luck. Is it sposed to work out of the box like that if you just open map?listen?
Port name is suspicious at best
even without port doesn't seem to work, not sure why
but yeah shouldn't really need a port, from what I understand this is sposed to punchthrough NAT
@fossil veldt you using BP?
otherwise perhaps you can use SessionInterface->GetResolvedConnectString() and pass whatever that spits out into the PlayerController client travel?
Has anyone successfully used the replay system in a multiplayer environment without losing the connection to the game server? I tried enabling Experimental_ShouldPreDuplicateMap in order to create a dynamic duplicated level and used the option LevelPrefixOverride=1 to play the replay in the duplicated level collection but either the game crashes or the map is not loaded completely and the PlayerController is stuck.
has anyone played around with doing profiling on a dedicated server? I'm having a bit of trouble finding away to do that outside of 3rd party tooling like perf_events. I'm wanting to do this on a Ubuntu server.
can I leave the other boolean returns empty or do i need to fill them in with the bool cable? I dont want problems down the road
Nah C++, I will have a look at what you mentioned, ty
@rich cradle I don't think that's what i'm after
any idea how to approach clients requesting data from the server/listener kinda like a http/ftp request? i have voxel chunks and i need to retrieve data from the server on request. so it'd need to be kinda like: client requests chunk -> server checks if client is in view distance -> server sends client binary data -> client receives data. and all of this 100% reliable.
Maybe I don't fully comprehend the problem but RPC call can be marked as reliable and can go both way so it should work for you
can rpc's transfer "huge" data?
i would like it to be kinda like a http request. domain.com/chunk.php?x=10&y=3&z=12
not exactly a http request
but kinda the same flow
and then it returns just data
aren't rpc's there to trigger events?
not to transfer data stuff
i dont want to use something for transfering the data that isnt meant for that use case
at the end they mention two settings in project settings which allow you to define the max dynamic array size
and memory
you are replicating data from the server to the client
replication would mean syncing data
i have an sqlite database for my world data, so it could request data from the database on the server, kinda like websites
you could
i thought maybe together with oodle i could have nice data transfer
server loads data, compresses it, sends it to client, client decompresses it, and loads it into the game logic
isn't an rpc more meant to be like "trigger chest opening event on all clients" or "trigger explosion on all clients"
and stuff like that
you can probably also do a http request from ue
rpc is for event in general
requesting something from the server is an event
do you run a ue4 instance in server mode on your server ?
are you able to load sql data from your ue4 instance ?
yeah listener/dedicated server will work with sqlite
and the client will just request if a chunk is touched and if its touched the server should send the data from the sqlite table
or the data it stored (cause the server has to load the data anyways)
then i think you can try first with rpc by adjusting the project settings and improve on that if required
rpc is UDP behind the scene so there is no reason it won't work and if required you can compress from ue4 before sending the data
just be sure to check reliable on your rpc
also if you send large amount of data you might have to see the effect on the bandwith optimisation system used by ue4 there are multiple settings and function to manage that
i'll check it out
bumping my question
hmm some have idea how to send sync to client when join in mid game to sync items on AI inventory
like one time rpc only on join and if is not controlled by player and is not server [not multicast]
Start Host
-Game start:
Server: Sync Paced for : Player_C_0.Inventory MainHand
-Spawn AI
Server: Sync Paced for : AI_C_0.Inventory MainHand
-Client join
Server: Sync Paced for : Player_C_1.Inventory MainHand
Client 1: Sync Paced for : Player_C_0.Inventory MainHand
Client 1: Sync Paced for : Player_C_1.Inventory MainHand
problem
AI_C_0.Inventory RepNotify was skipped
Ok, so this is weird
I started trying to debug my camera lock feature again tonight. I've never seen this before.
So the client is finding the closest target to the camera, and it is sending via RPC to the server the actor component that it wants to lock on to
The server receives a completely different actor's component.
That's why I keep fighting the camera system. The client is doing what it is supposed to do, in the sense that it is picking the right actor component to lock on to, but something is going really wrong along the way
Client Log:
LogRaevinCamera: Warning: URaevinLockArmComponent::GetBestLockTarget() - found best target component! The owner for said TargetComponent is 'BP_Enemy_DarkKnight_C_1'
LogRaevinCamera: Warning: Sending server target component with owner BP_Enemy_DarkKnight_C_1
Server Log:
[2021.04.30-02.28.30:496][180]LogRaevinCamera: Warning: URaevinLockArmComponent::ServerSetLockedTarget_Implementation() - Received new target component TargetComponent which is owned by BP_Enemy_DarkKnight_C_0
[2021.04.30-02.28.30:497][180]LogRaevinCamera: Warning: URaevinLockArmComponent::LockToTarget()
[2021.04.30-02.28.30:498][180]LogRaevinCamera: Warning: Set new targetable to a valid target component. Owner of target component is BP_Enemy_DarkKnight_C_0
[2021.04.30-02.28.30:498][180]LogRaevinCamera: Warning: URaevinLockArmComponent::ServerSetLockedTarget_Implementation() - successfully locked onto the target component!
[2021.04.30-02.28.30:507][180]LogTemp: Warning: Was NOT locked during previous frame, and we now are locked onto a target. Setting CMC's orient rotation to movement to false.
Wth?
I'm sending in a component that belongs to actor BP_Enemy_DarkKnight_C_1, but somehow in the RPC call, the server gets BP_Enemy_DarkKnight_C_0 instead?
How is this possible?
trying to debug the engine code and I just get disconnected from timeout. Not sure where it is mixing up the reference
I really wish the server would never disconnect me while in debug mode so I can take my time with the debugger
It's very frustrating
@meager spade how are you always online? Do you ever sleep?>
I don't think I've logged on once and you have been offline lol
Server DarkNight 0 might be your DarkNight 1
you mean it is normal
yeah ok
that makes sense
damn, thought I finally had solved it
it's AI, so no player state
print something else unique
and see if it matches
After many many tests, I can't get it to fail in single process / no server / running standalone
every time I select based off of camera input, it locks onto the right target
as soon as I switch it to standalone / not a single process / running standalone, it never works
btw there is a cvar
or some ini line
to extend client disconnect
in debug builds
oh good
because man, that is annoying. I'm trying to step into the net driver code for the first time, I can't just zip right through it. It goes on and on - it's like the damn energizer bunny in there.
thanks!
Do i need portforwarding to play multiplayer?
Basically, if you use Steam, you do not
If you use dedicated servers, you do not
If you roll your own NAT punch for another situation, you do not
In other cases you do
i wanted to have a host/client and some client. And i want to play on mobile. Can i use relays?
Ok thank you
Hi, in a multiplayer game, how do i check on client that the controller belongs to the game host
or that client belongs to the game host
Check that the player controller local role is authority
it will have authority even on client part of the host?
There is no such thing as client part of host
It's either authority, or it isn't
Replicated actors only have authority on the server
so when you run "executes on server" what does it actually do if host machine?
that implies there is a client part and server part of the host
It just runs on the machine. It's like writing a letter to yourself. You go out it in the mailbox them take it out again
yes but you can have concepts of client and server on one machine, they don't have to be dislocated
anyways, what you said doesn't work
client will have authority if it spawned actor
regardless if it is a host or remote
Is there a good tutorial for joining a multiplayer? And setting up an relay server?
so i need a better way of determining
Yea but does steam fork for mobile too?
A replicated actor (spawned from the server with replication) won't
Obviously a locally spawned actor always has authority
But I mean, that's up to you to know that in your code
I decided to do this, i will have IsHost flag on a controller, which i will set to true and replicate (it will be set to true if the controller is the only controller i the game, therefore it ahs to be host)
Client never has authority over their controller unless you screwed it up somewhere
And Clients shouldn't be spawning controllers
What do you guys consider as reasonable packet loss? At what point would you display a symbol to the user indicating internet issues?
iirc i heard they do packet loss over a sort of threshold
if you have X amount of loss for X amount of time, show the icon
same as ping, if ping is at X amount for X time (which is wildly different from your rolling average), show the icon right?
Yeah that makes sense, I would expect that as well
I was thinking 10% as the threshold
sounds reasonable
i didnt found a solution with a relay server, can somebody help me?
IDK man... QA recently added a bug which states "game is unplayable at 300ping and 80% packet loss" so maybe that's what we should aim for π
our QA likes to do stuff like that too
Same boat here haha that's why I'm wondering on others opinions on the threshold for things to be reasonably unplayable
yeah, 10% is pretty nasty, but still manageable
no game is "playable" at 300 ping with even 10 percent packet loss
with exceptions π
- Can i host a dedicated server on a raspberry pi? 2. if i want that every player can start a game(starts a dedicated server and joins them), how can i do this?
Thank you very much
anybody have experience with late-join/join-in-progress replication for clients? I have a spline-mesh actor that is generated/modified at runtime and the spline info is not replicated to the freshly joined client
the actor is spawned at run time and given a Spline Component, which is set to replicate, and for Server and Clients who are connected, everything replicates fine as it generates meshes, expands, etc., but a client who connects later will only see the replicated actor's location, with no spline curve data (and I saw SplineCurves is not replicated in the SplineComponent), or extra spline points, etc.
So i am looking to build a login system for my multiplayer game. From what i gather I need 2 servers 1 that handles auth and the the other being UE4 handling the actual multiplayer replication.
but how do i make them work in harmony
I guess an additional question I'd have: is it possible to set a variable of a parent class in the engine code to replicate without modifying the engine source? such as in the child?
Haven't tried myself, but I imagine you should be able to add them to DOREPLIFETIME
I'll give it a shot, wasn't sure if you could add inherited parent variables in there
well it didn't crash yet...
nah, connecting client crashed everything
the parents' UPROPERTY isn't marked as replicated, so you can't just toss it in there...
actually I think I talked myself through something...if someone can check my logic on this:
An Actor made on the server, before the client joins, which adds components and does dynamic things should only do that BeginPlay() setup stuff once on the server, and not all over again when the client joins...the client should receive the replicated Actor itself, right?
otherwise you're adding components and redoing all the stuff on a replicated actor, right?
Sometimes a replicated actor the server spawns doesn't exist on the client due to package loss.. is there anything like the "reliable" for RPCs for actors?
Actor spawning is already reliable
This helped me so much in finding out what needs to be reliable, what are actual bugs and what is just package loss.. thanks again! π₯°
Reliable should be things that MUST happen
Ah okay so it^s probably just the delay because the actor only exists for like 1 sec
Yeah that's probably it, if there isn't enough bandwidth it'll keep dropping the spawn packet, if the actor has a short enough lifespan it may never spawn client-side at all.
Playing a particle? Does it matter? Telling the server you interacted with something? Really does matter.
Replication is always reliable
but yeah ^^
makes sense
Also i learned (this was my first multiplayer) how important it is to do stuff in the controller and not the character
If the character dies the name of the one who was killed for example would be gone, and the sound not replicated because the actor who sent it is gone
make death a state, or at least for a little while
like Dota corpses sinking into the ground
@scarlet cypress if you're spawning a low priority actor and have plenty of high priority ones, it might take several seconds until your new actor panics enough to have the priority to replicate
and by that time, its gone
we had fun like that when a designer changed net priority of a trash mob to 100
mid game, when there is plenty of them, actors like projectiles, with lifespan of 2-3 seconds would rarely manage to replicate
Okay thanks a lot, ill take a look at that
you shouldn't really have anything above net priority of 4 or 5
so you think i should put the projectiles to 4 to make sure the shots hit?
you're more looking for a crazy high outlier
or is that too much?
ours are at 2,3
so, are splines just not a replicate-able thing? Because FSplineCurves is not setup for replication...so as a client I can't retrieve the spline information, can I?
I can't pass the SplineCurves struct variable through a NetMulticast for example and have clients match up, is what I'm basically asking?
so if someone late-joins a game in progress, and a spline actor has been modified, there's no way for them to get a proper updated spline actor
you can't replicate splines
oof thanks, big bummer...
gotta do some thinking
none of the properties in the struct are marked as replicating
from my understanding you can't pass a struct if the properties aren't marked?
all UPROPERTY in a struct will replicate
can i connect to non steam server if client use steam?
isnt that the way apex works on steam @gritty pelican
there's no such thing as a "steam server". Steam doesn't host servers or impose any restrictions on what you can connect to.
If your game on steam can only play with other steam players, that's something you've imposed on it yourself.
i thought that was how that worked. But i wasnt going to say that with out knowing for sure
CharacterMovement->MaxWalkSpeed needs to be set on the server and on all clients?
no
well kinda
but not in the way your thinking
prob
Is there something not clear with my question?
Many of you have requested a way to leave me a tip so I've created a PayPal and a Patreon.
PayPal: https://paypal.me/reidschannel?locale.x=en_US Patreon: https://www.patreon.com/reidschannel
Discord: https://discord.gg/PdvudWx
You asked for it so here it is! This is my Networked Character Movement Tutorial complete with a full download to the pr...
just watch this
Hey, i have a question. In Games like Hearthstone and Magic The Gathering you see your own cards on the bottom of your screen but your enemy sees them at the top of his screen. How is this done? Can you change the location of a replication?
I don't really need to see the cards in his "hand" but when an enemy puts a card on the field i would need to replicate this card anyway.
locations aren't replicated
PlayCard does different things depending on if the player is local to the machine
and by different things i mean, sets location differently
which you can basically do with a single mutator function
if the cards insigator is locallycontrolled/controller you play the card at provided location, else you play it in the mirrored position
to clarify, you can have a card location replicated here, but as a vector, not as an actor that replicates movement
OnRep, if its your card you play it at that CardLocation, if not you play it at CardLocation.GetMirroredPosition()
and simplest way to do mirrored position is to just rotate the card around the center of the "desk" by 180 degrees
i understand the logic behind this... but damn im lost how this multiplayer stuff works xD
only stuff you want to replicate gets replicated, along with of bit of engine stuff under the hood
just because a card sits on 10,10 on your screen doesn't meant it has to be in same position on anyone else's
alternatively, you can preplace an actor for each player
actually, im kinda half asleep
you can also just rotate the camera 180
and leave everything as is
or preplace automanaged cameras for players, defining their perspective
simplest solutions are best
if your PC has AutomaangeCamera ticked true, and you have 2 cameras, each with AutomanageForPlayer 0 and 1 respectively, placed on opposite sides of the desk
you don't really need to do anything else
engine will do it for you
Has this "AutomanageCamera" something to do with your "Pawn"? never heard of this π
its unreals way of aggressively setting the view target to automanaged camera until the pawn is possessed
in this case you don't really need pawns either
its a pre-placed camera actor on the level that has index of the controller that will use it as a viewtarget set on its details
i think i will restart my whole project. π
Hello all. So im looking through the ShooterGame project as I am studying it to learn more about multiplayer. I see the way its hosting sessions, When I launch the game Im able to host a game, select the map and game mode. This is using my PC as a Listen Server correct?
If that is the case say I wanted to host a dedicated server on my other PC. Wouldnt that make the Host option invalid? How would the Game Mode & Map be selected then? Unreal Docs doesn't really explain things like matchmaking or server set up..
The most simple question I need answered is how do I set my dedicated server up to where a player can select a game mode, then be taken to a server that has an open slot for him to join and play. Without the need for AWS
More indepth question is how could one use the "Host" function for not creating a Listen Server but instead a party system where one player is the party leader and is the one who will search for that game mode and take his party into a server open for them..
@boreal wadi "Unreal Docs doesn't really explain things like matchmaking or server set up.. "
I have the strange feeling that Unreal has a general problem explaining multiplayer stuff π
I, for example, still don't know how to use "player controller" in multiplayer, and i have read explanations and ways how to do this but nothing seems to work for me.
try the compendium, link is in top pinned message on the channel here
I'm going to check out the section about sessions.. I havent read all the way through it just yet.. Hopefully it can answer some of my questions
that was more for @ancient badge
i don't know how much session stuff cedric put into that thing
Hi! I have a little bit of problem. I have a building block (static mesh actor) with replication (component replication, "Replicates" flag, and the smooth sync plugin btw same effect with replicate movement). I made a "grab" system, and when I grab a block, the collision is need to be disabled. IF the Client grab the block, the server see the block without collision. But if the server grab the block, the client see the block with collision. I tried a lot of things to fix it, but I cant. Any idea?
collisions are local @narrow leaf
so client should turn off the collision on the block on its own end when the information that it was grabbed replicates
@boreal wadi in general you would need to either
send a login string argument to the dedi when first connecting for it to open an instance with the desired gamemode
or join to a lobby on the dedi and select the gamemode via the RPC
options #1 is simpler here
as for taking an entire party, one could fake that with steam lobbies
you can think of them as a steam hosted chat that can hold data, much like sessions
Here is my rep. EDIT: the upper event is run on server
so the lobby owner could select a gamemode on dedi and send an url via the steam lobby to the other party members
@narrow leaf send the pointer to the block you're grabbing through the RPC as an event input
makes it much simpler to handle stuff on the other side
Sorry, but what does the pointer mean? MY english is not too good
reference to block Actor
oh thanks
@winged badger Okay.. I was told that once before. To send args through the dedi with the desired game mode/map.. Just thought there was a more streamlined way to fake match making..
My idea is to spin up about 4 servers on my pc, have them running different maps/game modes once a player or party leader searches for said game mode they would get sent to that server address when its open.. Shitty thing that is bugging me is that I would (in the future) have to set up a crap ton of servers for each different match.. Which sucks because I only want to hold 10 ppl in a match.. I know a server could hold more but I dont know how to use that too my benefit. Sucks cuz only 10 ppl can play on a server at a time unless I'm wrong about this
server can spin an instance with a specific gamemode on request
so you don't have to have them pre-spawned
(i don't know how to do it, i know that it can be done)
WORD? Im not sure how to work that out either.. I need to google that.. I'm sure its going to require knowledge about making a matchmaking server..
once you are connected to it already, you can do it with ?game=<GameMode> argument to ServerTravel
it shouldn't be spectacularly difficult to do it while connecting either
Hmm I guessing that would be a arg passed through a RPC to the server.
so If im understanding right.. Player connects to one of the servers I have - they search for a TDM mode, If one already exists with space and the match hasnt started the join that instance, else the server will spin up another instance.. I need to find an example of this so I can see it in action.. Its probably not that simple or there would be loads of tuts on it lol
it is not an RPC argument
What is the proper way?
I was just looking at playfabs api I might have to use their matchmaking api to accomplish what I want. I was just looking for a simple way to fake matchmaking while testing with a few people..
wdym?
u oculd have a looping timer that looks for sessions nad joins the first one but that would be pretty hacky
-Brain storming-
Anyone have integrated the multi CC system in the multiplayer game?
Not like: stun and delay then remove stun.
there may silent, stun or fear that run away from enemy at same time. if you do delay and remove the stun. then you'll able to move while rooted.
Do anyone have any ideas?
im thinking to add unablemovestacks that if you got stun and root at same time you will get 2 stack. after end stun while root it removes 1 stack and you still not able to move until 0 stack.
gameplaytags
^^
isnt is only for GAS?
no
either have all rooted tags start with Rooted. or Status.Rooted or whatever then just match for the root Rooted tag
or have a FGameplayTag container that contains the tags that apply root that don't have to share the same root tag
and if you have any of tags matching Rooted. in first case or any tags that are in that container in second case
you can't move
i wasnt familiar for gameplaytags since never used, at the tick(in sample) are gameplaytags nodes costlier than variables for performance?
you need to check all CC's for matching it is disabled movement or disabled attack on gameplaytag i guess.
Got an oddity. I've got Jump setup (based on 3rd Person template) and the jump animation only plays for the server. Clients just show the character motioning up and down without an anim.
In the Animation Blueprint event graph the clients do not get IsFalling set as true, hence why the jump animation doesn't play.
I have the same character blueprint setup in another project and it works fine.
Any idea on what might be causing this? Maybe I'd changed something somewhere else that's creating this effect.
I should add that the clients show the jump animation playing on themselves, just not on any other player.
anyway, tomorrow I will do research on the gameplaytag. frankly i opened this topic at the wrong time since everyone sleeping rn.
im gonna sleep then good luck everyone
are you aiming for a kill cam or just a regular replay ?
if its a kill cam then dm and we can loose our sanity together, if not dm or reply here and I can walk you through it
Can help me to resolve the following packaging w64 error?
Missing precompiled manifest for 'OnlineSubsystemEOS'
ERROR: Missing precompiled manifest for 'OnlineSubsystemEOS'. This module was most likely not flagged for being included in a precompiled build - set 'PrecompileForTargets = PrecompileTargetsType.Any;' in OnlineSubsystemEOS.build.cs to override.
Please i 'm stuck on this
Hello! Does sockets rotate in dedicated server? While a listen server, the capsule is perfectly in the character's head, but while in a dedicated server seems like character is not rotating(like in the image). The red capsule is being spawned in the location that dedicated server is seeing it.
Will nativized blueprint cause less lag than normal?
Probably not right, onyl affects fps?
@scarlet cypress Programming itself, generally will not cause less or more lag. At least not in general sense. If you have a ton of shitty code that is lagging your server's FPS, you'll have some slower replication, but generally speaking if the server is still over 15fps, it should still be fine for clients in "Most" cases.But actual latency only comes from the networks that the server is hosted on and the client is playing from.
ok thanks
How disable tick for Server, but enable if Player is server
switch (XVisionNetMode)
{
case EXVisionNetMode::Both:
SetComponentTickEnabled(true);
break;
case EXVisionNetMode::Client: //Here
if (GetOwner()->HasAuthority()) SetComponentTickEnabled(false);
break;
case EXVisionNetMode::Server:
if (!GetOwner()->HasAuthority()) SetComponentTickEnabled(false);
break;
}
@gritty pelican Disable if (World->GetNetMode() == NM_DedicatedServer)
Can probably get world from this since it's a component. GetWorld() should work on it.
Alternatively, UKismetSystemLibrary::IsDedicatedServer(this) then disable, else enable
case EXVisionNetMode::Client:
if (GetOwner()->GetNetMode() != NM_Client && GetOwner()->GetNetMode() != NM_ListenServer) SetComponentTickEnabled(false);
break;
can i check like this?
or
if (GetOwner()->GetNetMode() == NM_DedicatedServer) SetComponentTickEnabled(false);
thanks, i think i understand
right?
switch (XVisionNetMode)
{
case EXVisionNetMode::Client:
if (GetNetMode() == NM_DedicatedServer) SetComponentTickEnabled(false);
break;
case EXVisionNetMode::Server:
if (GetNetMode() == NM_Client) SetComponentTickEnabled(false);
break;
}
To be able to connect not over lan only you need to integrate steam or an other service for the matchmaking right? With the ue4 only you canβt do distant multiplayer..?
Or is there a way?
@gritty pelican I don't know what the XVisionNetMode is. But GetNetMode's return has four main values. Standalone, DedicatedServer, ListenServer or Client. You want this enabled if it's running on a player's screen. Therefor you want it enabled if it's either Standalone, Listenserver, or Client.
Disabled if GetNetMode == NM_DedicatedServer. Cause that's the only net mode that will not be a player playing.
@meager spade You were right, it was just that the server had a different name than the client. The client is sending the right pointer to the server.
I thought the names synced; learned something new.
i got a new level that i made my multiplayer game run in, i just changed the level, and it has one player start in it, it works in editor with 2 clients, when i build it, the clients has no controll over their character, taking no input from mouse, keybaord, if i change back to old level. it all works, what can be wrong or missed with that new level ?
Does the character exist on the map already or is it spawned by the game mode?
game mode
Do you need to call the parent BeginPlay inside of BPs if your character class implements the C++ begin play?
or is that automatically handled for you?
i had forgot to choose world settings override game mode, and also forgot to take controll over character in level bp , begin play
Shouldn't need to do anything in level bp. If there is no pre-placed pawn with "auto possess player" set, the GameMode will spawn it's default pawn and give it to the PlayerController.
If that game mode is used for all levels, you should just set it in the project settings then you don't have to do a level override
i dont think so. I ran into this exact issue with my grenades
I ended up just sending the emission point to the server
hey guys, im trying to implement a simple multiplayer movement system, however only the server is able to move even though im running the code for both server/client on the server via events.
- Server moves, client can see server move.
- Client moves, server receives client movement request, but the client doesn't move.
Any thoughts why that is happening?
replicated variables only replicate from server -> client. You're writing code as if it's depending on "Forward Thrust Amount" replicating from client -> server
the way to pass data to the server is to add arguments to your server rpc
not by using replicated variables
ah! ok that makes sense, let me give that a try π
thanks @hollow eagle works now π
I am at a loss. I just don't understand what is going wrong here. I've been at this each and every weekend for many weekends. I just can't get it right.
Client sends actor reference to server. Server sets replicated variable (using onrep_) to the actor reference sent from client. The OnRep_ method shows a different actor reference set
I can see in the output that the server gets the right actor reference from the client. I can see the server sets the replicated variable. Then the OnRep method fires on the client with a different actor
set in the replicated variable
So my problem this whole time has not been the camera selection logic at all
Server
[2021.05.01-21.07.09:082][ 70]LogRaevinCamera: Warning: URaevinLockArmComponent::ServerSetLockedTarget_Implementation() - Received new target component, which is owned by BP_Enemy_DarkKnight_C_0 which has minion ID '42388C8F42103E938C37A78EDA25AD85'.
[2021.05.01-21.07.09:083][ 70]LogRaevinCamera: Warning: URaevinLockArmComponent::LockToTarget()
[2021.05.01-21.07.09:083][ 70]LogRaevinCamera: Warning: Set new targetable to a valid target component. Minion ID is '42388C8F42103E938C37A78EDA25AD85' and owner of target component is BP_Enemy_DarkKnight_C_0
[2021.05.01-21.07.09:084][ 70]LogRaevinCamera: Warning: URaevinLockArmComponent::ServerSetLockedTarget_Implementation() - successfully locked onto the target component!
Client
ogRaevinCamera: Warning: Sending server target component with owner minion ID of '42388C8F42103E938C37A78EDA25AD85'.
LogRaevinCamera: Warning: URaevinLockArmComponent::OnRep_CameraTargetChanged()
LogRaevinCamera: Warning: CameraTarget is VALID. Owner is BP_Enemy_DarkKnight_C_0
LogRaevinCamera: Warning: Camera target has minion ID of 0013BF5C4A2D358A604350860FA72EF6
and then the client locks on to the invalid target, which was never even considered for lock on in the first place
its way on the other side of the map
Does anyone have any idea what could cause this? I've never seen anything like this before
The replicated variable is being simply set to what the client passes to the server
If I run to the other end of the map, the GUID the server replicates back to the client, is the right GUID for that enemy, but it's not the one that was sent to the server or the one the server set to the replicated variable
So i did it and made a fully working multiplayer game..
But none of my friends want to play it..
So what do i even get out of this
That's a risk everyone takes when they make a game as an indie
I guess be happy that you managed to accomplish such a hard task? I am stuck here trying to figure out a problem that just won't ever get solved
I just want to be able to have a client send the server which target to strafe around, and that has been the most frustrating task in my programming career. I had more fun learning how to program my own operating system.
It should be simple, yet something is messed up and the server sends a different actor
Do it again and make a better one
No like they didnβt event download the file π
get better friends and do it again π
Hello im having a problem replicating a variable that is set from the input axis, it seems it always get set back to zero by the server. Im unsure on what Im doing wrong or if its possible.
variables can only be replicated from server -> client. Use an RPC to send data to the server
Hello Siliex, I set the variable on the server, but calculate it on the client. Its based on input axis.It seems like it is replicating but also been set back to zero because the server has zero input
Use an RPC to send data to the server
input data is not automatically sent to the server
you have to do that yourself if you need it
I believe I am
You're never sending the inputs to the server though
you call Server Set Parry Vector which doesn't use any data from the client
OK, multiplayer roguelike with drop-in, drop-out coop.
How should I store the player's character, and whether or not they even HAVE a character (after death, first startup)?
Should that touch GameInstance at all or just be handled in the PlayerController with SaveGames?
Why does Event Handle Startin New Player seem to bypass all the Gamemode functions around spawning pawns etc?
Is it meant to be a catch-all instead of overriding all those functions?
If that event exists in my graph, always start as spectator
Has anyone replicated Boat riding? Let's say you have a char BP and boat BP. You either possess or attach your char to the boat, whatever is easier to replicate.
Whats the authority if for c++..role_authority and hasauthority() aren't doing anything...tf
and isServer() also no work ..dafook
I just read that replication is different when its for more than 4 players? What is different?? (I know you cant build an mmo thats not my goal im aiming for servers with like 40-50 people)
if (GetLocalRole() == ROLE_Authority)
and if (GetLocalRole() < ROLE_Authority) to check if it hasn't
@lyric mural it isn't different, but i would not attempt to do more then 4 players without the use of c++ unless the game is turn based
blueprints have around 10% networking functionality exposed to them
Yeah. Blueprint is missing a few serious key features for larger game multiplayer. No replication graph, no fast arrays, no repconditions just to start.
guys. whats the maximum world size for dedicated server ? -HALF_WORLD_MAX to HALF_WORLD_MAX ?
my concern is physx and floating point.
so it means -10km to 10km ? thats not enough for me π¦
π€
You could always just shrink your characters? O.o Then the world is larger!
has anyone tried that size ? I guess CMC get into trouble at the corner of the world
I am designing a FPS game, need a big desert containing several oasis.
@rose egret I would live with the limitations for now and make something larger when UE5 + 64bit floating point precision rolls around
@potent cradle Are they actually moving systems like CMC and such over to doubles? I know the world timers have started to see some changes from floats to doubles.
Good question π€
I would imagine so, otherwise the practical benefit is greatly deminished
I'd be surprised
The ServerTimer or whatever variable it is, is now a double. But the systems around it are still doing math in floats. So I suppose by 2030 we can expect to have servers that can stay up longer than 3-4 days consistently.
So I suppose by 2030 we can expect to have servers that can stay up longer than 3-4 days consistently.
I think I remember a discussion a while ago about this topic
That a clock or timekeeping used on the server started getting unreliable after a few days
(Haven't actually had my server up for that long yet, so haven't run into it)
Blew my mind π
Since the EOS channel is pretty much inactive. I have a question here. Does EOS provide servers to run the game? Or is it just to store certain data.
How exactly does it work with the dedicated server?
Thanks
I'd like to use my game with steam multiplayer but i can't find sessions..
- Did the Engine Config change
- Enabled Subsystem Steam Plugin
- Steam is running (with two different accounts)
What did i do wrong?
Hello, I have a working beacon system in editor and I hardcoded "127.0.0.1" as address. The problem is I need to get this information on the server dynamically (it won't be the local address outside of the editor).
This code works but only on the client.
This code should work but I get an unresolved external error when I try to compile.
Does anyone know the simplest way to get to know the address of the server (beacon) so I can pass it to the clients?
unreasolved external symbol = you didn't add a module you're using in your build.cs as a dependency @south rampart
Not sure if that changed, but iirc you can't get that IP without basically asking "someone" for it.
Yes I don't know which header I need to include.
Probably the SocketSubsystem of my platform. But I can't include the header for the windows one : s
its not an include problem
you'd get a compiler error before you got to the link errors if it was
Not even from the beacon itself? The beacon works. I just need to get that address to the client
You mean if you are already connected to it?
This is what I do on the server. After I can connect to this beacon through 127.0.0.1:7787 (defined in DefaultEngine.ini) on a client.
I need to write a system that will connect to this beacon even if the address is something different. Getting to know this different address is where I am stuck π
PingBeaconHost.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class ISocketSubsystem * __cdecl ISocketSubsystem::Get(class FName const &)" (_imp?Get@ISocketSubsystem@@SAPEAV1@AEBVFName@@@Z) referenced in function "public: static class FString const __cdecl APingBeaconHost::GetNetworkURL(class UObject *)" (?GetNetworkURL@APingBeaconHost@@SA?BVFString@@PEAVUObject@@@Z)
This is my exact error
so add "Sockets" in your public dependencies in your buld.cs
Like this? I see someone also comment out OnlineSubsystem. Shall I uncomment that one?
i did say public
Sorry I am new to this part of UE4 π . Rebuilding
It worked! Thank you!
Though GetLocalHostAddr() did not return the address I wanted.
I will try GetMultihomeAddress() and GetLocalBindAddr() in the hope they return what I need. I don't really know what I'm doing (my education on networks is very vague), so I'm just firing wildly :p
I love how PawnLeavingGame is actually the player controller being destroyed
Makes a lot sense
Hi! I have a replication lag on the client side. When the client grab a block, its laggy (sliding). Any idea? Video: https://www.youtube.com/watch?v=r-7py34sxe8
@scarlet cypress you first need to create session, and then find session and then join session ( you might be doing in wrong order )
The Session System in Unreal Engine 4 gives you access to many powerful online features such as the server browser, setting a maximum player limits, setting private and public slots and much more. Using this system is very straightforward and only takes a few blueprint nodes to get working. In this guide I will show...Read More
I have a question about Net Serialization with UStructs. I have this implementation and it is very simple since all I am doing is just replicating 1 HitResult and the HitResult already has a NetSerialize function I can use. ```cpp
bool FGameplayAbilityTargetData_BulletTraceTargetHit::NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess)
{
HitResult.NetSerialize(Ar, Map, bOutSuccess);
return true;
}```
However recently I changed what I am trying to replicate. Now instead of 1 hit result I am trying to replicate a TArray of HitResults TArray<FHitResult> HitResults. So how can this be done? The TArray class doesn't provide a NetSerialize to use so I'm kinda stuck. Would I need to loop through the array and call each of the hit results' NetSerialize? That doesn't seem right to me since the array isn't being serialized
Aahhh, thanks. I didnt know that it was that little. Do you know why its so little?
@lyric mural Blueprints aren't meant to be a main programming tool. They're a middleware meant to help programmers handle simpler tasks easier, and to allow designers to do simple things without exploding a program. Even if you could add some of those things to Blueprint, it'd be a waste of time because those things are there for hardcore optimization. Putting them in Blueprint allows people who aren't ready for them access to those tools, and also kind of ruins some of the optimization having to deal with the blueprint virtual machine.
@kindred widget thanks, Im going to start learning cpp
Whenever i use "Net PktLag=900" it changes the ping for all clients and not just the client that i selected. is there a way that i can assign different pings to different clients in the editor?
net.pktlag=900 should be doing what you want
think that's the same command your using though
@kindred widget I appreciate your help last weekend. It turns out my issue is not with the camera logic
The code you gave me is working as it is supposed to.
Something weird is going on where when I pass the target to the server via RPC. I pass the target to the server, the server gets the right target (I verify by spitting out logs regarding the target received). Then the server sets the target to a replicated variable that fires an OnRep on the client. When the OnRep fires, it is returning a different actor component than what was set...
Not sure how that is even possible
It shouldn't be. Depends on how the OnRep is set up.
Thank you so much!
Then in the GetLifetimeReplicatedProps...
DOREPLIFETIME_CONDITION_NOTIFY(URaevinLockArmComponent, CameraTarget, COND_None, REPNOTIFY_Always);
Out of curiosity, why a softobject pointer?
I was trying to avoid a hard reference to the target and I don't think TWeakObjectPtr replicates.
It isn't an asset though. And it isn't like your targeting component's class CDO isn't going to be loaded anyhow. So it won't matter if Unreal loads it into the background via hard pointer.
Dunno if that's the problem I haven't used softobject pointers outside of asset referencing. StaticMeshes, Texture2D, etc.
Ok
Well, I can convert it to a hard pointer. I'm willing to try anything at this point. I'm about ready to re-write everything related to this feature. But I'd like to not give up on it.
I gave the enemy character's a unique guid that replicates so I can easily track which actor is which between client and server
That's how I know from the logs that the actor is the same actor that is being passed from client to server, and then that it is incorrect when the server passes it back to the client via the replicated CameraTarget property.
To be fair. I don't think a hard pointer will change anything. AFAIK, the only real difference between a normal hard pointer and a softobjectptr is that the softobject includes a path location on disk. Not certain of that's replicated as well, but it makes softobject pointers quite a bit larger than normal pointers.
yeah I think you are right there
I've never seen this before. It really suggests that I am doing something wrong... but really, it is as simple as taking the RPC param and setting it in the replicated variable. I am wondering if the issue is because the target I am replicating is a UWidgetComponent
UTargetComponent really is a UWidgetComponent
You're doing all of the logic on tick aren't you?
Well, I added the log writing on tick for debugging purposes. But the code only tries to get the best target and call the server RPC when I hit TAB
I got so desperate, I even added the guid as text above the enemies lol
But I mean the rotation stuff, it functions on tick?
and I added particle effects for "this target is near enough to me" and a separate one for "this is the best target right now"
no it doesn't
When I hit TAB, the lock arm just grabs the best target, closest to the camera
*closest to the center of the camera, and limited within a small sphere range (800.f)
then the client sends that best target to the server via rpc
and that part is working
What is in your OnRep function?
Makes sure that the server and client agree with the target being set. I send the RPC, but I don't change the characters movement (e.g. rotate towards target on tick/etc.) until that OnRep method fires off
I also use it to stop locking onto a target if that onrep fires and the camera target is no longer valid
Well, I tried to send the method, but a bot came up and said I couldn't send the message o.O
That's the method
So at the very beginning of it, if the camera target is valid, I write out that GUID
Here is the log output (I just tested it again)
Server:
[2021.05.02-17.30.04:740][729]LogRaevinCamera: Warning: URaevinLockArmComponent::ServerSetLockedTarget_Implementation() - Received new target component, which is owned by BP_Enemy_DarkKnight_C_2 which has minion ID 'D2500BAC4D097C8FF126CB9FD777C457'.
[2021.05.02-17.30.04:742][729]LogRaevinCamera: Warning: URaevinLockArmComponent::LockToTarget()
[2021.05.02-17.30.04:742][729]LogRaevinCamera: Warning: Set new targetable to a valid target component. Minion ID is 'D2500BAC4D097C8FF126CB9FD777C457' and owner of target component is BP_Enemy_DarkKnight_C_2
[2021.05.02-17.30.04:742][729]LogRaevinCamera: Warning: URaevinLockArmComponent::ServerSetLockedTarget_Implementation() - successfully locked onto the target component!
Client:
LogRaevinCamera: Warning: Sending server target component with owner minion ID of 'D2500BAC4D097C8FF126CB9FD777C457'.
LogTemp: Warning: APlayerRaevinCharacter::OnSwitchFocusedReleased()
LogRaevinCamera: Warning: URaevinLockArmComponent::OnRep_CameraTargetChanged()
LogRaevinCamera: Warning: CameraTarget is VALID. Owner is BP_Enemy_DarkKnight_C_2
LogRaevinCamera: Warning: Camera target has minion ID of C23EE23445CC8AE0D2CEAEA8C0400D8C
So everything agrees until the client gets the variable replicated on the OnRep
and that guid belongs to the enemy, not right next to me, which the client sent to the server, but the enemy all the way across the map
so like, just now, I tested again:
Server:
[2021.05.02-17.34.43:156][127]LogRaevinCamera: Warning: Set new targetable to a valid target component. Minion ID is 'C23EE23445CC8AE0D2CEAEA8C0400D8C' and owner of target component is BP_Enemy_DarkKnight_C_1
That's where it sets the variable
Client:
LogRaevinCamera: Warning: CameraTarget is VALID. Owner is BP_Enemy_DarkKnight_C_1
LogRaevinCamera: Warning: Camera target has minion ID of DFC4E4FD4C729C7610CFF2971CF9D8A6
and if you look, that guid is owned by a different enemy
I know you don't have the answer, I'm sharing it more for you to scratch your head and ask "wth?" like I am doing lol
I think I am just going to redesign this using an interface and only replicating the actors instead of their target components
@kindred widget well... I converted it to a hard pointer, and it seems to be working now...
This will be the fourth attempt at getting it to fail
and it has been working
Does anyone know if there is a way to join/host sessions without opening a new level? I want to create a seamless lobby in the main-menu
@crystal crag Haha. I dunno. Like I said, I never use Softpointers for Actors or Actor Components like that, I've only ever used them for asset loading in places like inventories for icon textures or like storing the mesh that a piece of armor might use. Cause you can have all that data saved and a new one can be loaded up if needed and it doesn't matter if it's a different one than the original because they're all the same. π€·ββοΈ
does anyone know if the hit object instance index is reliably the same on server and client? im seeming to have some problems with that π€
@ancient lily You 'might' get some similarities in testing but it isn't promised I don't believe.
i think im approaching it wrong anyway, replication keeps breaking my head
I've written a few different managers with fast arrays for removing and adding HISM component meshes at runtime and the only solid way I have found to identify them is via specific location/rotation.
Cause those will pretty much be the same on client/server.
yeah i mean, ive started replication from scratch and read a lot of stuff about it, and yet i still know nothing and need to re-test stuff again time over time
such as in, if i multicast spawn a replicated actor, will it spawn twice on a client because it would also spawn on the server and be replicated anyway
Haha, yeah. The RPC vs replication gets a lot of new people.
ive written bytecode but this is more complicated, and thats not even a pitfall
My steam multiplayer with the default ID just sometimes doen't get a search resul and sometimes it does
What is going on there..?
@scarlet cypress With 480?
yeah
You're fighting against the horde of other people using it.
So it cant determine if its a different game when its using 480?
And will just be unable to join?
TLDR, there are a ton of people using it and sometimes the results of that flood your finder, but none of them are for your application so they don't get displayed.
so just make a high number of search results?
and hope it's in there
is locally controlled
if thats what you mean
@scarlet cypress another reason I like to use the EOS subsystem.
I found a way to fix it, just set max search results to 1000 π π
so when i spawn an actor with a specific transform, on clients replicated via multicast it only seems to affect the first component under its root and not all of them ... weird
is that how thats supposed to work π€
yeah .. seems like it really is the transform spawned on the server and replicated (all components replicate) which actually isnt getting replicated for all actor components other than the first .. whew
yet another change of plans
Hello, i have an Cube that is replicated by the server to all clients, it has "Text Render Components" on them. In my blueprints, i checked with a "Print String" if the variables are passed until the "set text", everything seems to work, but in the game i don't see any change. Every "Text Render Component" shows its standard value.
Any ideas why?
In Singleplayer this works.
The Variables i'm getting from a "Data Table"
Did i miss a point of replication?
How are you doing the replication?
Well, i checked the "Replicates" Box in the Actor. Made a Costum Event with "Run on Server". For my Variables i tried "None, Replicated and RepNotify"
Wouldn't you want it to be a multicast event?
Run on server = client calls method to run on the server (if owning client)
I might be misinterpreting what you want to do, but I don't think run on server would be right
For something like setting the text in a textrender. You'd simply want the text render component on an actor, the component does NOT need to replicate. The Actor does. Then the actor needs a replicated string/text/name set as RepNotify. Inside of the repnotify, you get your string/text/name and set the textrender's text there. And then you set the string/text/name on the server.
When i use multicast i get one with my variables and a second one without them.
Don't multicast state. Let it be a repnotify.
You mean the Function that is automatically created when i use repnotify?
UPROPERTY(ReplicatedUsing = OnRep_CameraTargetChanged)
class AActor* CameraTarget = nullptr;
void URaevinLockArmComponent::OnRep_CameraTargetChanged()
{
UE_LOG(LogRaevinCamera, Warning, TEXT("%s()"), TEXT(__FUNCTION__));
if (CameraTarget != nullptr && !CameraTarget->IsPendingKill())
{
...
In a similar fashion. You'd handle the text changing inside of your rep notify method
Oh, sorry forgot to mention that i'm using only blueprint
I don't think repnotify is possible in BPs
Damn, i just had a Deja Vu π
If you look at a Variable inside a blueprint you can set it to repnotify
oh cool, glad I was wrong then
Repnotify is available, conditional replication is not.
You can set replication types, and notify, but you cannot disable replication via bool at runtime in blueprint.
@kindred widget Thank you, repnotify worked
Anybody knows how to replicate boat riding? Let's say I have a char BP and a boat BP. The char either posses or get attached to the boat, whatever is easier to replicate.
I think you would do both? I would think that you would attach the char to the boat, then have the player controller posses said boat
Can any one suggest me reliable voice chat system for UE which will work Cross platform ?
If I change a member in a struct is the whole struct replicated or just the changed member?
By default only the changed member
what is the non-default and when does that happen
Non default is marking the struct Atomic
Not sure if that ensures all modified values are replicated at once, or the entire struct, though
I think it should be the former since replication is sending fundamental types over network and reconstructing the higher level object from it
It should, but I don't know for sure
Vivox
@finite goblet by having custom NetSerialize u write your own serialization and send the struct as whole.
@finite goblet unreals documentation for net serialization is in NetSerialization.h (half of it is comments)
By the way I'd love to know for sure what Atomic does exactly
Hi! I have a replication lag on the client side. When the client grab a block, its laggy (sliding). Any idea? Video: https://www.youtube.com/watch?v=r-7py34sxe8
@narrow leaf Looks like basic replication? Instead of setting the cube's location like that, why not simply attach it to a spring arm or something on the character? Then all clients can move it based on the character's rotation.
So i have a very basic function I'm trying to replicate.
When the character clicks on an actor it toggles the material from default to green.
This test is me trying to troubleshoot a consistent problem I've been having where custom events running on server don't get called. Replication works coming from the server, but not from the client.
the server can call the event but not the client
I've heard a little about how sometimes you need to make sure the client is the owner. But I've been working off of many sources on how to do basic replication and this hasn't been of any focus.
both the actor and component are set to replicate.
If i understand well the rpc work from client to server but not server to everyone ?
The server can call multicast but the client cant call run on server let alone multicast, so it doesnt run on the client at all
when you put a breakpoint on "On Clicked" does it trigger ?
yeah, i have it in a different window and i can see it running up to the ServerChangeColor
have you tried putting both your rpc as reliable for now ?
I did in a different blueprint, but client is right next to server. I'll try though
this is coming from the server with reliable set on both events. The execution stops at server change color without running it.
is you actor present on the map at the start of the game or you spawn it later ?
your*
there's no characters placed on map at start. They spawn in using players starts
the actor with on clicked is a character ?
oh, i misread that, yeah the actor is already placed
had print at each step and breakpoint
i think its probable that the rpc work but your material change doesn't
you may already know but when you put break point on server and start as listen client the breakpoint on server won't trigger and the inverse is also true
it doesnt run here though, so it wouldnt be the material function
how do you know it doesn't run ?
i watch it
did you put a breakpoint or a print ?
one sec
yep doesn't run when coming from client
skipping ahead steps out of execution
your screen doesn't prove anything
add a print to serverchangecolor
with a long duration to be sure to not miss it
this doesnt change anything
skip the rpc and connect directly to your material change
from on clicked
does it work on the client ?
no, but That was the first thing i tested to make sure i wasnt missing the unrelated stuff.
The client doesnt turn the sphere green when clicking it but the server does and the client can see when the server changes the color.
My only problem is the run on server event doesnt get called, I've already troubleshooted everything else.
I have larger systems that i get the same issue when trying to replicate.
could you take me a screenshot with the modification i asked please
yep and this doesn't work
course that works, but then its not replicated
okay i need you to stream your screen to help you further if you don't mind
yeah sure Thanks for the help btw
@queen pine Your issue is likely ownership, if you haven't gotten that far yet.
confirm its ownership
Yeah look like it
You will have to go through your PlayerController/Character to get this working
Clean solution would be some ActorComponent on the PlayerController, something like a ClickManager.
Then you can get the Controller of the Player that clicked, get the Manager, perform an RPC inside of that (given it's marked as replicated), passing the Actor along.
Then the on the ServerSide you can do your material stuff
InteractComponent would be a clean way to do it indeed
Another way, with the same manager, would be handling clicks as LineTraces inside that Manager and not using any of the Click stuff of Actors
This is my main project.
Its an interaction system with the logic in the door itself, but It makes since to me now that it needs to be done this way instead
to increment on cedric idea, I would make an interface for interactable object to implement
that way you can keep the logic of the action hidden inside the actor
when you linetrace you cast to your interface on hit
and if it cast successfully you send the reference of the actor via rpc to the server to call your interface function
okay I'll give it a try
hello there,
can you guys recommend a good course/tutorial series on replication with blueprints?
on the unreal youtube channel I only found one old and crappy livestream
I already know the basics, I mainly need examples and use cases
@pastel marlin and everyone else thanks for the help. Got it working!!
I will take this newfound knowledge to big and high places.
Is it by design that apex destructable meshes don't seem to show up when playing as client on dedicated server?