#multiplayer
1 messages ยท Page 528 of 1
But the existing Epic examples have a lot of this in them
It's good to follow their example most of the time
np's
Hey there !
Do you have any recommendations/keywords what to use when implementing save game systems for Multipayer (self hosted games) ?
We'd have to save states of actors and positions , plus spawned objects . Quite a few .
Multiplayer doesn't change much
My personnal recommendation is to avoid the built-in save system
It works very well and is very easy to use, but changes to the data you save can break the compatibility of save files
Saving all the data you need to Json files with compression on top is what we're doing - not exactly fast to load, but can be done on a thread, and gets you files you can read directly for debugging
Is there a way to get server crash logs.
For example Firebase crashalytics.
UE4 crashes should leave you with a minidump you can debug in VS
Ok I know about that, but let's say if I have a cloud instance and I have configured in such way that it should destroy itself after match is over or somy crashes
This is reasonable configuration to avoid extra billing
UE4 has a crash report server tool, normally you will tell the engine to send any crash reports to a special server where you can retrieve them.
Yes this is what I was looking for
Will the report in proper format or do I need to embed the template for crash reporting
The crash report will just be a minidump plus a log file usually
If you need anything else you'll have to modify it, e.g. to upload a users' save file or something.
Can't find a decent tut on it anywhere unfortunately though
Anyways this is more than enough for me , thanks bro
@chrome bay your mentioned wiki states that the latest version of UE4 doesn't have this feature
IIRC you have to build the engine from source to get it
No it says the source code have been removed completely
Could always grab it from an old engine version and update it I guess
I guess they don't support it anymore: We do not support the use of Crash Reporter externally, although you are welcome to take the code that exists and adapt it to your own needs.
They never really supported it well anyway
Easiest is to fetch your crash dump in saved and send it somewhere
@chilly mist if you haven't read it yet, the official docs on input might help you build a bit of a road map in your head there's a couple of useful sections https://docs.unrealengine.com/en-US/Gameplay/Input/index.html
The Input object is responsible for converting input from the player into data in a form Actors can understand and make use of.
@hoary lark Right thanks, I'll take a look.
But side question, Unreal Engine's documentation website seems to not run CSS for me? I mean it looks like it's rendered in a really awful way. Anyone else has this problem?
you're not using internet explorer are you?
On Firefox
yep looks like ass on FF too... works OK on chrome, vivaldi, and even MS Edge for me
o_o
not sure why I'm not a web guy
That sucks. Maybe I'll learn why such things happen later.
But thanks for checking it for me.
Question. What is the cost of having a high net update frequency when nothing inside the replicated actor is actually replicating (no replicated variables) The only reason I want the net update frequency very high is so that the actor spawns as instantly as possible on clients when created on the server. Is the overhead cost after the actor is replicated and spawned high when the net update frequency is set to a high number? Or does Unreal have a built in optimisation for this, meaning that if there is nothing inside the actor replicating, the actor isn't costly? The only thing I'm worried about is the impact on the host's CPU? As a constant checking with the net update frequency has a CPU cost, no?
NetUpdateFrequency doesn't affect initial actor replication
also the cost is the server CPU time evaluating actors for replication
which is also by default capped per frame iirc
you can easily net saturate yourself to where nothing works with wrong frequency/priority settings and enough actors
Confusion about Replay and networking. I have actors that I create at runtime aka spawn in and populate with staticmeshes. It seems when I perform a replay even though my creation method is a NetMultiCast and the replay shows the creation of the actors, the movement of said actors isn't being applied. This has me thinking the recording is probably doing it for Actors that were created at that moment and when the replay happens, it creates bran new actors that I guess it doesn't see as the same? What would be a way to have it recognize the actors as the ones that were moved?
For clarity the creation happen before recording starts.
The creation happens before recording starts? ๐ค
@jolly siren Empty map starts, actors spawns in.
Then the user may record
stop recording
hits play
it seems to still spawn in the actors
but movement isn't replicated back
thinking it might be because the movement it recorded was for "different" actors
The only thing I guess i could do is have lots of maps with the actors already in it?
but that would be a last resort and seems kind of silly to have to do
Have you tried starting the recording before the actors are spawned as a test?
No.. even if that works it isn't how it's supposed to be used at all
Not sure if really insightful ethier?
Because either way the actors are recreated but it might prove my idea wrong or right
ok I'll try that
Of course the actors are recreated during replay playback
But I mean to say
while the replay does "recreate" I literally call the creation process of the actors it "recreats"
@jolly siren Same results
making my theory sound more likely
but there should be away for replay to apply the movement?
Perhaps I need to rethink how I apply the move
instead of depending on the actors to replicate
just depend on the actions that cause the move to happen to replicate well
is it common to see some sort of "jitter" on the other players in multiplayer with just a template project ?
Every now and then the character sort of jitters a few uu up and down again, before continuing as normal ๐
Depends on the network conditions (and the template)
Hey, so I have a bluperint widget that I want to display when someone gets killed by a projectile/bullet fired by another player, and make it display player names of the player who got killed, as well as the killer. But Idk how Im gonna get that information over to the widget :l
Do you guys have any suggestions?
(Please ping on reply โค๏ธ )
Everything is set to default. Seem to be related to collision and mesh edges and not the replication as i first assumed
Hey guys, trying to learn multiplayer replication, and I'm trying to do something I thought would be super simple..
How can I set all players to have the same camera / overhead POV?
Thought this would work, but nope. My server does it correctly, but client pawn does not. His view just gets snapped to his actor location
@thin stratus Hey, I remember you helping a little with my dedicated server. I have a quick question, since I don't have an AppID, i'm using 480. Do I need to have steam open to act as the "master server" or without it? WIthout steam open, it will launch perfect but will only allow clients to join who don't have steam open.
Any suggestions?
You need steam to be open to use steam, yes
You can also only actively do this with 2+ pcs or a virtual one
Cause steam can only be open once per pc
Steam needs to be open to use it, yes.
And you can start the game and the server on the same pc.
So I would need another steam account if I wanted to connect to it?
DedicatedServers might also work with just the dlls of steam in the binaries folder
What would fix the error then?
Most likely, yes, you can try to move the steam dlls into the dediservers binaries folder ,but it can be that if you start the normal game on the same pc that it won't let you boot into steam. Usually you need to pcs.
But there are steam+ dedicated server tutorials on wiki that should explain this.
If you later distribute the server you only need the dlls though
DedicatedServers don't need an actual account with steam
That only applies because I'm using spacewar right?
which requires me to have steam open?
I'm sorry, steam has to be open for clients and listenservers
DedicatedServers work with the dlls in the binaries folder
Meaning steam has to be closed?
Not sure you can host a dediserver on the same pc that you play on
But the error you posted isn't really pointing to steam being on or off
It just says it tries to bind to the port and fails
Make sure you have the netdriver setup in the config files
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
I've had this in there
There should be another thing about that
I only have my phone rn and it's 11:30pm, so I can't reall help much more.
Check if you have the config setup properly
Oh geesh! Go to bed haha. I'll double check. Thank you
@sly arch did you follow a youtube tutorial for it?
I have. I've build my source build 3 times already trying to copy a video as well
Huh
lol
only thing I can think of is to check this documentation
not sure if it'll help though
I tried that, but the problem is that I don't have streambridge as i'm using the default SpaceWar appid
whenever I close a TCP connection that I was listening on and restart my program to listen on it again linux keeps giving me address already in use errors for like 30 seconds - after that it's fine. what setting do I have to change to make this go away?
hi, how to use steam function RequestInternetServerList?
how would one go about making a server kick a player out of the game? I found the AGameSession::KickPlayer function but was wondering where and how this was called?
@twin minnow i create function in my controller
{
UE_LOG(LogTemp, Warning, TEXT("FUNCTION START: KickPlayer"));
FText KickText; // = TEXT("INITZALIZE PLAYER FAILED")
GetWorld()->GetAuthGameMode()->GameSession->KickPlayer(this, KickText);
}```
thank you @gritty pelican I will try this out
Or to easy way; make execute command "disconnect" inside run on client.
oh jeesh i didnt looked at messagged time
nvm
how i can connect to steam server use ip?
Has anyone made zone capturing over multiplayer? for example, red team stands on zone and capture points. where do you store these added points? and how do you replicate it
@honest scarab I think it is doable by using ReplicationGraph with Grids
Basically we split our world into grids and mark those grids when to replicate or when not to
hey, the official findsession node working with steam + dedicated server in 4.24 (of course after new steam things added in 4.22 is set correctly)?
i see the dedicated server in steam list, but seems find session unable to find it ๐ฆ
@thin stratus I think we can host th dedicated server on same PC, because UE4 does that
@rich ridge you can ๐ ive tested exactly this yesterday, but runned into a small issue
Ok what is that issue
Yeah you probably can, but you have to put the dlls into the binaries folder, which is a big step some peeps forget.
^^
Othewise the DS won't properly use the subsystem
exactly
And I only did like 2 games or so with Steam Dedi Servers and that was 6+months ago so I can't recall :D
@thin stratus what is do is I run my Linux Dedicated server under Linuxsubsystem
Of windows
without steam btw it works (of course ports should set via cmd line), but with steam since dll is runtime loaded and seems it is locked, the second gameserver from same directory unable to load steam dll's
I have absolute zero experience with steam, so can't help. Sorry bro
I m waiting for epic online services
@lean river I think you can do this with Linux Subsystem if steam can cross compile
You can have any number of dedicated server with Linux containers
Just need to do some extra work to get it working locally
yeah actually you can have any on windows too :D
just copy the server build to different dirs and works..
@lean river but it's not smart way ๐
i know, but what we can do ๐
If you do set-up Linux containers it will give you fair idea exactly how your Dedicated server will scale realtime
I will do the exactly same what I recommended you and will share my resources to all, but not now. I m waiting for epic online services.
This is for local orchestration
This technology is maintained by Google
For your information this technology was developed initially for Pokemon GO
It has UE4 plugin
great thx! would read
btw ive figured out... why i was unable to find steam dedicated sessions
vanilla find session node still do not return dedicated server nodes.. even if every macro set correctly :D
advanced session able to find sessions \o/
so i guess i need write my own find session node
Hey guys, a more general question from me
what would you say is the modern standard approach to hit detection with bullet travel?
better to go with client side checking with server validation
or to implement rollback with bullet travel
I'd love it if you know of any good resources on this topic to share
check ut and shootergame source, lot of good technique implemented in both source :)
you can learn a lot from those..
also blizzard made some good GDC talks about the netcode and techniques used in overwatch: https://www.youtube.com/results?search_query=gdc+overwatch+netcode
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
Is Begin Play called after the initial replication bunch gets sent?
@manic token I've just done it with rollback.
For character vs character, it's pretty easy
I would love to see a rollback implementation for fun โค๏ธ
projectile forwarding is easy too.. ^^
so atleast server / client would be in sync regarding the projectile position
I found rollback to be much easier than predicted projectiles having tried both now, to be clear the rollback solution uses a psuedo-projectile system - but it's less flexible so it kinda depends what you wanna do.
Rollback is very straightforward. I need a blog :/
But TL;DR store a circular buffer transform history on the server of each player, and define the maximum rewind time. When you receive a client hit, get the closest "interpolated" sample (based on current time - (clients ping * 0.5f)), and check the hit against that rewound capsule
A capsule can be very cheaply represented as a distance-from-line-segment check too, so you can easily define a "expansion" radius
The trick is you also need to "pause" bullets on the shooter if their latency is > the max rewind time.
Otherwise they can't hit anything ๐
And as it turns out.. players do not like that
Why a circular buffer?
Ah it doesn't have to be, I just found it to be easier to update. You timestamp each "sample", the continuously overwrite the oldest one
ahh okay, I'm in the process of writing rewind of sorts in order to make simulated proxies appear where the shooter thinks they are in a replay
yeah that would work well for that too
The plan is to store the history of updates from PostNetReceiveLocationAndRotation and then use historical ones in SmoothCorrection instead of the current ones
Lagged behind by shooter + the simulated proxies ping
yeah that would work!
I think this should be able to work for live spectating as well
InTarget->GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_Pawn, ECollisionResponse::ECR_Ignore);
I'm calling this in a server rpc on a replicated capsule component of a character but it doesn't seem to have effect on the cilents
Are you also calling it on the client?
nope just on the server
Alright thanks
np
Is it OK to set the ownership of a character gun to the character, so that the gun can call RPC events (such as changing fire mode)? Is it dangerous in any way / not recommended?
Nah, that's quite common
ok thank you
Ah so, I wanna set player locations / rotations for every player on the server, Would the best way be to:
- ServerRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation)
- MulticastRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation)
- Each client set the location / rotation for the actor
or
- ServerRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation)
- Set Replicated Variables
- Client OnRep Set Location + Rotation
Or another way perhaps?
Not really sure best way to go about it
could anyone help me with this issue? I can't call the Set Weapon and Spawn Weapon functions inside the widget blueprint because the player ref is always set to null, and I just can't figure out how to get it to work
nevermind I'm actually so dumb
Can't use RPCs in a widget
he isn't
I just put the player ref setter to when the button is pressed and it works
Isn't onclicked a widget override?
you can't have RPC members in a widget, you can call them just fine
the actor that RPC event belongs to has to be an owned one
ah
I can't believe it took me this long to figure out what was wrong
I stopped working on my game for 2 weeks cause I was just sick and tired of trying useless fixes
i told you to expose the player ref on spawn last week ๐
ohhhhhh
Ah so, I wanna set player locations / rotations for every player on the server, Would the best way be to:
- ServerRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation) - MulticastRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation) - Each client set the location / rotation for the actoror
- ServerRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation) - Set Replicated Variables - Client OnRep Set Location + Rotation@winged badger You know an answer to this one?
you got roll to your rotation?
ay?
I'm using my own movement component so replicate movement doesn't seem to work for me
its generally SetReplicatedVariable, SkipOwner
Ah yea ok thought so
local player needs to simulate it
yah
but if you have 0 roll for your rotations
oh right you can just send a yaw yea
rotation is usually sent as NetQuantize_Normal
as the length of the vector doesn't matter
and its smaller
ah ok
either way, if you try to convert a vector to rotator you lose all roll information
O rly
That's confusing, Wouldn't it just take XYZ components
and just put them back into a rot
thats different
if you do
FVector MyVector = SomeVector;
FRotator MyRotator = MyVector.Rotator();
basically replicating a rotation as a direction vector
then you lose roll
but it is a most common use-case
the NetQuantize_Normal only allows for 0-1 component values
but its only 16, instead of 32 bits per component
ahh so you gotta normalize the rotation?
Or is it automatically normalized when you set the value
turning the vector into a rotator should give normalized results i think
would need to check
ah
or rotator into vector
the length is undefined in transformation, so it makes sense for it to be 1
Yea
Replicated variables only change if set by the server right?
and you don't have to multicast for them to update for everyone?
well, its kinda confusing if you do the BP networking
yea
as OnReps fire every time the value is changed, even locally
in c++ its much cleaner, its only a replication callback, and only for clients
Oh nice
It was so messy in BP i hated them
So am glad they are actually good in C++
also c++ version can do
UFUNCTION() void OnRep_NyFloat(float OldValue);
having a pre-replication value in argument
ahhh nice
net driver uses reflection to figure out which OnRep overload to call
so you only need to change the OnRep function itself, rest is done for you
any chance someone could help me out with something regarding sprinting real quick?
i am trying to replicate sprinting, whenever i hit my sprint button the movement becomes super choppy and jittery. from what ive read online i have to change the movement speed on the server and on the client. everything ive tried that seems to work for other people isnt working too well for me. heres my bp if someone could let me know what im doing wrong. thanks!
you should set the walk speed locally immediately
when the button is pressed
which you're not doing at all
so client is doing its movement at walk speed, server at run speed, and ends up being corrected constantly
so when i hit my sprint button the first i should be doing is changing my walk speed?
yes
if you wait for server to process and replicate it back to owning client
you'll have a stutter whenever you activate the sprint
if you set it locally right away, the SavedMovement packets using higher speed will reach the server about the same time server gets the message to increase the speed server side
and then everything remains smooth
thank you so much man
i could not figure that out for the life of me
got it working now!
in c++ its much cleaner, its only a replication callback, and only for clients
@winged badger Is the only for clients part set in stone or can you make OnRep trigger on the server also?
Trying to set my locations like this but the listen server isn't getting the OnRep calls like you mentioned:
void UCNetworkedMovementComponent::OnRep_NETposition()
{
if (OwningPlayer)
{
OwningPlayer->SetActorLocation(NETposition);
UE_LOG(LogTemp, Log, TEXT("OnRep_NETposition"));
}
}
Is subobject replication made easier in UE 4.24?
server can call whatever it needs to when setting the variable
but OnRep will not fire on server @fossil veldt
@chilly mist no, but its fairly straightforward on any version
ah ok
What's the condition for being the server?
is it just:
if(Role == ROLE_AUTHORITY)
its GetLocalRole() now, Role is private
and that is not server condition in every, just most cases
locally spawned actor will have role authority on clients
ah :/
If it's a replicated component owned by the client it would have authority then?
no
there is also GetNetMode()
Oo that's probs better actually
@winged badger It seems like a lot of stuff to cover. The outer Actor needs to implement ReplicateSubobjects. The subobject itself needs to override IsSupportedForNetworking. I copied code from some wiki for ReplicateSubobjects and frankly don't understand it at all. And it doesn't seem to be documented anywhere.
there is one example
bool UAbilitySystemComponent::ReplicateSubobjects(class UActorChannel *Channel, class FOutBunch *Bunch, FReplicationFlags *RepFlags)
in the engine
Sure, I see. But how can I approach to understand these code?
sorry, i don't get what part confuses you
Like what does ReplicateSubobjects do, what is UActorChannel, what is FOutBunch, replication flag, what does WroteSomething do...
๐
FOutBunch is the packet sent to the clients
WroteSomething is just a boolean for the return of ReplicateSubobjects function, it will return true if there is something to replicate
@winged badger do you know of a reliable way to generate a timer across both client and listen server? Atm I have a timer that gets set on begin play for listen and client controllers, but only the client's timer gets fulfilled. Any workarounds for that?
ReplicateSubobjects gathers all the objects replicated via that actor channel into a packet
and ActorChannel is a channel used by an actor to replicate over
wdym "only client's timer gets fullfilled" @stark hull ?
After the initial delay of the timer the callback function fires off only on a connected client
as opposed to it firing off on both on listen server and client, as they both initiate the same timer on their ends
there can be dozens of causes for that
i can't really guess which one is it like this
void ATuTPlayerController::BeginPlay()
{
Super::BeginPlay();
if(IsLocalController())
{
ConstructPlayerOverlay();
GetWorldTimerManager().SetTimer(UIEnableTimer, this, &ATuTPlayerController::OnShowUI, .5f, true, 1.f);
}
}
and there it is
IsLocalController() prevents it from firing on server for client owned controllers
and that timer shouldn't execute on server anyways
UI is strictly local
To clarify, what I was looking for is if I have a client that is behaving as a listen server I also wanted to have the timer to trigger on their side
This code works if I put a breakpoint and step through the execution, but if I let it run in PIE it doesn't activate on the listen server
but it does on the client xD
that would probably be because you use a reference to the pawn in ConstructPlayerOverlay()
controller, by default, doesn't have a pawn possessed on BeginPlay (due to how network actors are constructed, this is true only on server)
hmm, Anybody know what the best way to handle hitboxes is? Do you just spawn em as DefaultSubObjects on the character class? Or spawn them seperately and then attach to component by bone? Not really sure
void ATuTPlayerController::ConstructPlayerOverlay()
{
if (PlayerOverlay)
{
if (!ActiveWidget)
{
ActiveWidget = CreateWidget<UUserWidget>(GetWorld(), PlayerOverlay);
}
}
}
you should do all that in the AHUD derived class btw
HUD's deprecated no?
yikes, ok was roaming the forums and kept seeing people mentioning that HUD is deped
@stark hull They probs meant Canvas which is what you used to create User Interface in back in the day before UMG / Slate, Still don't even think it's deprecated there's just not that much reason to use it
@winged badger Great to know, but like, these look like in-depth knowledge of UE. How can I get to know about these myself?
reading the what little docs there are, then the source code
then years of practice ^ ;D
also reading in-depth conversations on this channel doesn't hurt
So pretty much toughing it out with C++ comprehension ๐ฑ
But yeah, I just learned something about IsLocalController from the conversations above o_o
on occasion the documentation is actually in comments in the header files
example would be NetSerialization.h
Looks like it :) <
it is bad
What's better way to do it?
Ah but see the problem is none of them are actually proper hitbox systems
They are all litterally per bone
they just hitscan the mesh and get the closest bone
a physics asset is literally a bunch of capsules, same thing u are doing
yep you would
@winged badger no idea why, BUT removing the initial delay solved my problem... wut
GetWorldTimerManager().SetTimer(UIEnableTimer, this, &ATuTPlayerController::OnShowUI, .5f, true, 0.f);
switched from 1.f to 0.f
I thought Physics Assets were intended to be used for Ragdoll and Physics Based Anims
o
But when you RayCast against a mesh aren't you having to do calculations based on what triangle was hit ect
That's why the RayHit in engine litterally hits against the mesh surface
nope u cant trace against triangles in a skeletal mesh
Hi im trying to make a 3d widget that is replicated to all players can use. that updates when player click on a button on it
Cool
Hey does anyone know what the Waste column is referring to in the Network Profiler? The docs describe, Total Size, Average Size and Count, but not "Waste":
https://docs.unrealengine.com/en-US/Gameplay/Tools/NetworkProfiler/index.html
Tool for displaying network traffic and performance information captured at runtime.
im having an issue after updating to 4.24 where i cant connect to a dedicated server
the server log loops this for 60 seconds after the connection attempt
after 60 seconds, the client log prints this
just tested with a listen server (same machine) and it does the same thing
Does anyone see where the engine adds to the UNetConnection::Delayed array?
I can't find where they add anything to the array
ah I found it
DelayedPacket& B = *(new(Delayed)DelayedPacket(SendBuffer.GetData(), SendBuffer.GetNumBits(), Traits));
Kind of a strange way to add to an array
It's how you call a constructor without allocating new memory
ahh okay makes sense
still having my issue from earlier, but trying to play as a client in PIE gives me more in my log
the subsystem line prints every frame
still looping the other lines every second
im not using an online subsystem as far as i know, but i am using uworks
which shouldnt do anything in PIE anyway
you using UWorks Subsystem?
i ended up not using it, and using the built in steam subsystem
actually i just removed the dependency for that in all the uworks build.cs files
and now it works in PIE
if i use Dedicated server, i need use if(SteamAPI_Init()) or if(SteamGameServer_Init()) or if(SteamAPI_Init() || SteamGameServer_Init())? SteamAPI_Init() only for clients?
@dreamy dove its how much cpu time was wasted figuring out if this property should be replicated to the client because it dint change or needed to be replicated at all.
perfect example would be something like InitialSpawnLocation its a vector that says where this actor initially spawned from... only changes once in its entire lifetime. If you replicated this properly normally it would be 100 waste all the time. It never changes!
but if that same property was replicated with COND_InitialOnly the waste will be 0, as no cpu time is spent trying to replicate the property.
most of the time you can ignore waste, but if the majority of your properties have waste with like a hundred of these kinds of actors, maybe try lowering replication update rate. Or moving its logic to RPCs, really really really depends on your game.
there was a video that epic made that explained other methods of handling this exact problem, it was a stream at one point. anyone remember?
This week we'll be joined by Ryan Gerleve and Dave Ratti to discuss general server optimization in UE4, as well as techniques and solutions to improve your Actors' performance in a networked environment.
NEWS
Unlocking Breachโs combat with Unreal Engine
https://www.unrealen...
Hi guys. I am looking for a way to save all the clients stats like health, money and other variables. I know how to do this locally with savegame but how would one do this with multiplayer to avoid cheating? If someone could point me in the right direction. that would be very much appreciated. Thanks in advance!
I'd store them in the player state
That's not really saving.
It has to be saved so its there the next time the player opens the game*
and there is no way to make a save system that can't be hacked
Saving for when the games is off.
Ohhhh
Yop, soooo. DedicatedServer + Hosting them yourself + Backend.
well you could make a database for all your players and store it somewhere on the interwebs
At which point you will face $$$$ costs.
Sooo, think if you really want to go that far or just make a ListenServer based game that (maybe) earns you money..
At first I just want to learn how to set it up just so its not saved locally
Been looking at MySQL. Is that a good place to start?
This is not related to UE4 then anymore. So it might be better for you to look that stuff up in general.
You'll also need a way to identify your players.
Which means either you tie in something like Steam or your own Account System.
MySQL is one way to do it. You should maybe look up the diff between SQL and NoSQL and all that stuff and decide on your own.
Alright. Thanks!
@half jewel - amazing, thank you for the information and the link to the video, this is exactly what I'm looking for! Yeah I can I imagine that if there are hundreds of these that waste could start to add up. Going to take a look at this video you linked and see if I can better understand the output of the network profiler. Looking forward to the experimental network insights in 4.25!
@winged badger I have another issue with weapon selection ๐
this is in my gamestate blueprint, and does a loop through every single player to set the weapon they chose before spawning and then spawn the actual player BP with the Chosen Weapon being passed to it and then spawned in its hands
for some reason though, it isn't working, and I already tried to set Chosen Weapon as a variable in the gamestate so that it is saved before the StartingPawn is destroyed, but that didn't work either
Been looking at MySQL. Is that a good place to start?
@steady aspen Depending on how much data you're saving and if you're using Steam you could use their Steam Stats api via steamworks
I will not use Steam. The plan is to have our own system @fossil veldt
Yea fair enough then, Might be worth having a look into MongoDB, MariaDB or MySQL then with a rest API
Then use VA Rest or another plugin to push / pull info from the server
Are any of them free? or atleast cheap
Depends how you mean free, You'd have to host these somewhere
If you host them yourself sure they'd be free kinda
Minus electricity bills and cost to run them yourself
Or you could use an online hosting company
which would probs cost a bit
If you're just opposed to using steam but don't mind using another system you could go with playfab
I think they also have a stats storing system
Yes I know that would cost, but I was thinking about the actual programs if they were monthly subscriptions or what kind of plan they have
Nah they are just Database Servers
if you run them locally there's no cost
other than the system you run them on
You should maybe take a look at Dockerized Containers for running the Databases in, that way you can scale them nicely and move them wherever you want
they should in theory run the same on any system
MySQL is a widely used, open-source relational database management system (RDBMS).
Thanks ๐
No worries
Another thing
You should be careful with this solution to not let the client be authoritative over putting data in the databases
Because then they can cheat the values locally and save them into the cloud
So you will want checks and to have the server do this to make sure people aren't saving cheated values
Don't know if you ever played Modern Warfare 2 but that's a great example of not doing that
People can change any of their Values locally and they save to the cloud
because they just take the clients word that the values aren't cheated
So you might want to have some kind of master server system that is responsible for setting the stats you want
Yes I will do that. Are there any places that are good for learning more about this?
Yea there's tons of info on database and rest api
they might not be specifically for games but the concepts are the same
A good example you might wanna look at is WoW private servers
as they are open source and do pretty much exactly what I just said
Usually use a mySQL backend, so you should be able to get a good idea for how that system works
and that works on an MMO scale so is pretty bulletproof and should work at pretty much any scale you need
Sounds good. Thank you very much for your help, it is much appreciated
You're welcome
Good luck
Also
If you wanna get some understanding of how Rest API works
One last question though. Where would I download the stuff I need for a dedicated server. I only found some links which lead to a dead gitHub with no content
A good way I learned was to download a program called "PostMan"
and then tinker around with the spotify api
Dedicated server for a database?
Or for UE4?
UE4
Afaik you have to build it from source
And then tinker around with some extra stuff
or
I think it should say on the UE4 Github
^ Depends on what kinda scale you want really
I cant find the source on their gitHub anymore
make a bp struct like db tables
and make a array in game mode
use it like sql
but there only have a big disavantage
@steady aspen I think you have to get added to the Epic Games team somehow
or you can't see it
when u shutdowning server. these data will loss
Can't remember how you do it
I see
Thank you
no woz
Has anyone made a smooth sprint in multiplayer?
During a speed change, my player twitches
@gritty pelican how do you handle sprinting atm?
I change the speed on the server side when I click on the button
maybe i can use smooth sync?
you change max speed on server or?
yes, on server
max speed isnt replicated so when you only change it on the server the client will walk with the old max speed and the server will correct the client all time when they are too far apart
okay, with smooth sync plugin all work
you could change the speed on the client instantly when you start sprinting and also on the server (so they would match most of the time, but thats just the easy solution and you will still get some corrections from the server when you have a bad connection etc) ... the right solution would be to add it to the saved moves so they both match up
I tried testing with bad ping. Jerking will always be
Even if I change the speed on the client and server every tick
yea you would need to extend the cmc and create a saved move ... then it would work "fine"
Ok, i will try
took me a day to realize that BP "Open Level" always result in non seamless travel ๐ฆ
in fact, it is equivalent to UEngine::Browse
Anyone managed to build dedicated server on 4.24.3?
I have the LobbyPlayerController (LobbyPC) and this gives me the playersettings values I want but when I then go to my Gamemode And get it through the cast to LobbyPC and get the playersettings values there the value is empty. What am I not getting here/ doing wrong?first picture the GM second the PC
BeginPlay might be too early
just try with a small delay of say .5
see if it works
@mental geode there are no guaranteed that BeginPlay starts earlier than OnLogin, better not assume that and tweak your logic a little bit
but I see you are trying to implement a character customization here. it could be done using UE4 built-in features. to persists object through level and network, better sub class PlayerState
to customize hero spawning process, sub class GameMode and override some function in there, your life would be much easier
why voice chat doesn't work for me ๐ฆ its soo weird
I am using Lan and listen server. did all the configs though
how would we know?
nvm solved it.
Does a shooter see the person they're shooting at back in time by (shooter ping + victim ping)? Or by (shooter ping + victim ping)*.5 ?
okay cool, that's what I thought. Just wanted to make sure. Thanks James ๐
@native olive Thanks I managed to fix it! I indeed was doing stuff in the wrong blueprints
is there a way to compile all blueprints in my project at once? I have this issue evertytime I change something in a struct I have that I have to manually go to every blueprint where its referenced
and click compile was wondering if theres a way to just compile everything again
just hit play button
has anyone made replicating zone capturing?
replicating zone capturing?
Where did the server get hosted/how do i connect with the integrated multiplayer of ue4?
I cant find any guide to the concept of the networking like which function is for connecting, event on connection lost. I only found something to execute a blueprint โcodeโ on server and/or client side
Oh and pressing the play button compile automaticly everything? Sl i dont need to press compile and play button both? ๐ฎ
Sorry, so has anyone made a game mode where you have to capture zones, but that variable is properly replicated? I cant get a variable to replicate to all clients from the game state.
BP's
show what you are doing then
Coming from #animation
Hi Guys i have problem with my Client Character Animation its so glitchy when player moving or running keep shaking i can't find a solution in google
^ i need to clarify, it does work on server side, but not on clients
Yes its works on Server Side normal but on Client Side its Glitchy Player Keep shaking
you may have a look on settings for the character
and?
same
yes...it does not mean it will work for all the cases
idk i have other projects same settings working normally
if you can AB test this character against default third person one, and see no difference - issue in networking
ok i will do that good idea
ping me when you will have the results
then issue in networking setup...
Im using The Default Axis Move Forward and Move Right
i will check then What is going on
@dawn summit Now i Unticked Mesh Component Replication Walk and Jump Are good but Sprinting still glitchy
And all Fixed Thanks Mate for support xD
hi there, i have a blueprint actor which has a function to set its relative location. it simply moves 50 units along its forward vector whenever the function is called. however, when i try this in multiplayer unreal says it does not have an owning connection. i looked it up and from what i gathered there needs to be a playercontroller and an owning connection, like with a pawn. so i would need to rewrite that function now to pass the actor to (for example) my pawn and move it from there? that seems fishy to me. is there no other way to call this function and have the actor move itself?
or maybe its supposed to work, i just am doing something wrong. i have set everything to replicate with the actor. no clue what i must do here without rewriting alot of my blueprints just for multiplayer.
you need to stop what you're doing, read eXi's compendium (pinned messages), read some of the UE documentation https://docs.unrealengine.com/en-US/Gameplay/Networking/index.html and then try again
multiplayer was never going to work out of the box
and yes, its worse when you make a single player mechanic first then try to make it work in MP after the fact
@hoary lark @winged badger i have read through the compendium and the docs. that is why i came here to ask if i have overseen something or if that is just the way to go to have my pawn do all the controlling of the movement
no owning connection means you tried to send a server or client RPC through an actor instance that doesn't have a PC as the end owner
thats what i did, i have that aactor without an owning connection, but i kinda expected its movement to be replicated to my clients, so i sent an rpc from that actor to the server, and there set its location to have it replicated to all other clients. but seems that is not the way to go. any tipps on what i can do?
i tried to follow an object oriented principle here, where the actor moves itself
after its function gets called
https://docs.unrealengine.com/en-US/Gameplay/HowTo/Networking/ReplicateFunction/index.html ("Server and Client Replicated Functions have some restrictions, for one they can only be used on Actors that have a Net Owner. Actors have Net Owners if they are a Player Controller or owned by a Player Controller. For example, a Pawn possessed by a Player Controller can have Server or Client Replicated Functions executed upon it.")
simplified: either the server owns this thing or a client owns it. if the server owns it, the server moves it. if the client owns it, they can tell the server to move it. the server always owns it unless they tell the client they can own it.
its basically a static mesh actor
just a blueprint wrapped around it
who owns it_
unreal says noone ๐ค
Hey guys I am getting this crash while launching my dedicated server, any ideas?
2020.03.15-18.24.10:320][ 0]LogCore: === Critical error: ===
Unhandled Exception: SIGSEGV: invalid attempt to write memory at address 0x0000000000000003
[2020.03.15-18.24.10:321][ 0]LogCore: Assertion failed: Index.IsImport() && ImportMap.IsValidIndex(Index.ToImport()) [File:D:/Epic Games/UnrealEngineSource/UnrealEngine-4.22/Engine/Source/Runtime/CoreUObject/Public\UObject/Linker.h] [Line: 110]
if I'm understanding correct
- you want the client to have control over this thing. therefore you need to send an RPC from the client. you can only send an RPC from the client from some actor which the client owns. the client by default owns their PlayerController. so you could either send an RPC from your PlayerController telling the server "please move this other thing" or you could set ownership of this thing to the client and call an RPC from it directly
- when you move it, you don't use a multicast. if the actor is replicated, its position should be part of its replicated properties. on the server you just move it, and it should soon move for everyone else
also I am loosely mixing the terms "ownership" and "authority" and I shouldn't be. by default the server has authority over everything, it may not have any net "owner" as you are seeing
furthermore the server generally retains "authority" over everything even if it is "owned" by a client - but if the client "owns" it, it can at least make requests to do things to it (i.e. send RPCs from it)
@hoary lark your understanding is correct. i can move the thing the by setting its location within my pawn blueprint. however, i want to call a function from the actor (on the client), and in there it does some calculations. i am missing the step that after the calculation is done, the actor can somehow inform the server and all other clients about its new location. see, its all in the actor without an owning connection. i need to find a way to have me accomplish this, because as soon as i make an rpc from the client to the server within that actor, it does not work. and i know now why it does not, because no owner. that is why i came here to ask if i can do it from within that actor, so i dont have to rewrite alot of my bps.
if its a static mesh actor, it should be owned by the server, right?
"Server and Client Replicated Functions have some restrictions, for one they can only be used on Actors that have a Net Owner. Actors have Net Owners if they are a Player Controller or owned by a Player Controller. For example, a Pawn possessed by a Player Controller can have Server or Client Replicated Functions executed upon it."
so i take this quote as a word now, and i have to somehow rewrite it, thanks anyway @hoary lark @winged badger
if this actor should only be controlled by one player, you should set that player's PC as its owner and then you can just do RPCs on it whenever you want. if it needs to be moved by anybody then it should remain without any owner, and you should probably route RPC requests through each PC
(or maybe someone more experienced than me has some other more elegant solution, I still haven't done a ton of networking and also am running on 4 hours of sleep thanks to my ๐ถ )
@meager spade yeah i think i can do it this way, i have an interface call on the client and somehow that confused me (without real reason, just my weird brain), will just make the rpc to the server from pc, and from there call the actor interface, dengit ๐ problem solved without too much overhead, thanks everyone.
if that static mesh actor is present on the server, it should replicate to all clients
if its spawned on server and replicates yes
its a level (static mesh) actor actually, but just a blueprint around it. what if its not spawned on the server?
i have problem with Steam function GetAllItems. When I try to call it on the dedicated server to get a list of items, nothing happens. Maybe this function is only for clients?
When i test the multiplayer twinstick example, is there a way to switch the current running process? Because if i hit esc the debug stops and i cant switch from client to server for example
hm someone know why, skeletal mesh armor via master pose (or animation blueprint copy mesh animation) does lag behind or forward the charackter on clients?
do i have to convert the armor pieces in runtime to a single skeleton mesh?
Someone know where i can access the name of the network connection/player? So for Example Client_1 or Server_1?
When i print a string to debug log then there is as the prefix the name of the connection
I believe you can get it from the playerstate
why would there be documentation
it's not a standardized format
it's just whatever they serialized in some engine version
Does IK foot/legs and hands require a lot of replication bandwidth?
Hm, So in multiplayer, only the player himself can see the IK changes, not other players? :(
that depends on the game
FPS, fingers wrapping around a gun
makes little sense to even run detailed IK for other players, you won't be able to see it anyways
for other stuff, not that hard to drop a trace when doing a step and calculating IK locally
there isn't any need to replicate anything, generally you care that you see other players moving fluidly, not so much if one of them stepped into a shit decal ๐
IK is done in the AnimBP anyway
using data which is already available
all you need to know is the gun and its all done locally. No replication is needed.
I replicate one thing for the IK. The weapon itself.
how i can get port with BP that listening on dedicated server?
Thanks for the explanation :) IK legs can be quite visible in some situations. If I choose to replicate (if I need to), is there a big difference in the bandwidth between players?
Copy :)
i have full leg IK, hand IK, etc
with 0 replication
even Turn In Place doesnt use anything replicated
If function A is a server RPC, function B is not RPC, then when A calls B, is B only executed on server?
Does anyone have any experience with releasing a dedicated server + packaged game on steam? Our client can't see any servers even though the dedicated server is online, it was all fine before we changed our product status to "pre-release" state, it also works without steam
@chilly mist yes
hm does anybody know why skeletal mesh components, like custom armor.. gets clippy/lag infront of the charackter on clientside while moving? i used to copy the animation with master pose and blueprint copy variation
does thats means i have to merge on runtime the skeletal meshes into one on runtime, everytime a player change a armor part?
Should I generally use Rename to set an UObject's outer, when dealing with subobject replication?
you should generally have actor as outer so it doesn't change when replicated
Allow me to describe my problem. I ran out of ideas.
I'm making a multiplayer inventory system ( plugin ). Characters can pick up, and drop items. If server player's character picks up an item, then drops it, then the client player's character can also pick the same item up, and dropped it.
But if client character picks up the item first, then when it drops the item, game crashes due to nullptr.
My item is structured with an "item core" UObject, and an "item" Actor. The Actor is just a wrapper of the core. When an item is picked up, its Actor wrapper, with its 3D model and stuff, got destroyed, and the item core gets added into inventory. When an item is dropped from inventory, an Actor wrapper is spawned by the item core. The core then fills itself into the wrapper.
It's like the game works on more complex behavior, but crashes on simpler one.
Is GetOwningPlayer the same like GetPlayer 0?
hey anyone played with / using replicationgraph here ?:)
@twin juniper In a widget?
So is there a difference or is the owning player always at array 0?
Well again, owning player in what context?
ah so when i am connected, the array index 0 is the server or the own player?
Sort of, yeah. Depends on where you are calling iz
oh
i thought it is always similar
so in normal blueprints
I am still wondering why i have the option for replication in events for "Run on owning client"
I mean it is the same like "Not Replicated" didnt it?
Run On Owning Client means it's moved from server to the owner of the actor
You should read the network compendium that is pinned to this channel
Ah that makes sense, thank you ๐ Ill look into it ๐
Can i start multiple Matches in a single Server? For example in a racing game starting a own Match for 2 players while 4 players are in an other Match?
negative
You can host multiple servers on one box, however (which is how it normally works)
The Player Controller can have replicated properties right?
I'd assume they only get replicated to the server?
Yep
Anyone managed to build dedicated server on 4.24.3?
@fluid finch Have you been able to accomplish this? I spent all weekend trying to get a dedicated server up in 4.24.2, I was following the wiki for 4.18. When I run the Server, it never seems to load the map & open port 7777.
@fluid finch Have you been able to accomplish this? I spent all weekend trying to get a dedicated server up in 4.24.2, I was following the wiki for 4.18. When I run the Server, it never seems to load the map & open port 7777.
@vital pecan not yet, but my co-worker does. I'll let you know once he shows me
Thanks, that would be amazing ๐
Such a problem. When I connect to the server, some actors do not replicate the variables. Maybe you need to enable Always Relevant?
Hey guys, first off sorry for the re-post, didn't see this chat area before i posted my question originally.
I am trying to get my demo going, been working on my project a while now and I finally think it is almost ready for a demo phase, however I am wanting it to have some co-op ability in the demo. What would the recommended way to do that be? I can't decide if it should be client hosted or setup on a rented server. I am also on version 4.24.3
Rented server is expensive. I would try hosting yourself during your demo phase. I used Gamelift for a day and it was $20 with 0 traffic.
Wtf
i made my own chat server with UE4
lmao
all lobbychannels connected to one chat server. so you can talk even you connected other lobbyservers
Hi all, ive been having headache over trying to integrate gamelift into ue4
anyone here have experience with running linux dedicated servers on GameLift?
I look for someone, who could help me in a Project with different Tasks (paid)
feel free to message me.
Things they are good to know/must to know:
- XSolla Login & Shop
- Multiplayer (especially in Racing & Character Movement)
- Dynamic Player Clothes - Switching Jacket Mesh if player bought it
Hopefully its not wrong in this channel, i didn't found a better place and i cant find a rule which says that i am not allowed to ask for paid help/development ๐
easy scheme for multiple servers 
@twin juniper #looking-for-talent
Thank you! @chilly mason
Hey guys. Can someone please tell me if there is an easy way to set variables in the game sate from a blueprint widget. Right now I found a work around where I create an event in the player controller, set that to server only and then that event sets the variable in the game state, I trigger the event in the player controller from the UMG widget. That works, but it seems quite messy. Any tips? ๐
Hey all, Im trying to get my character movement working over network i have no idea why the movement speed is going heywire the values are the same on client/server then the client just goes weird. Im just using regular movement input nothing special. https://gyazo.com/b9657da42ec91cec65cdf221deebb156
When i set the checkbox run Dedicated Server, what happend? So did it automaticly start the server still if i set the autoconnect to false?
And how do i execute command only for the server there? If i use the Has Authority while the client not connected, it doesnt work properly. Is there a ServerStartedEvent or something like that to do actions when the server started?
hey could anyone help me with a method of getting the steam username, i have this but it doesnt seem to work
anyone have an issue on 4.24 with Logout() not being called in game mode?
I want to start working on a small multiplayer fps. Could I use unreal blueprints for networking logic or would I have to learn networking in cpp
blueprint works fine
cpp is a bit more capable but as far as learning goes, bp will make it much easier to start
cool thanks
Has there been any news regarding replication of Chaos Destruction?
It will happen, right?
FRootMotionSource_ConstantForce *ConstantForce = new FRootMotionSource_ConstantForce();
ConstantForce->InstanceName = FName("PainKillerHookProjectileRootMotionForce");
ConstantForce->AccumulateMode = ERootMotionAccumulateMode::Override;
ConstantForce->Priority = 1;
ConstantForce->Force = NormalizedDirectedForce * Speed;
ConstantForce->Duration = TimeNeededForConstantSpeed;
ConstantForce->FinishVelocityParams.Mode = ERootMotionFinishVelocityMode::SetVelocity;
ConstantForce->FinishVelocityParams.SetVelocity = FVector::ZeroVector;
HitCharacter->GetCharacterMovement()->ApplyRootMotionSource(ConstantForce);
Im using a constant force on the server but it doesn't look smooth on some clients
stutterish
is there something I can do so the force on the character looks smooth
FRootMotionSource_ConstantForce is bugged
think you could cherry pick fix from 4.25 already if needed
im using 4.23
ill just use other stuff instead of constant force I guess
The cilent on the right is clicking on the floor and should turn towards the location clicked, but it doesnt, the second client (left) does see the actor rotating what could I be doing wrong, Im' just calling AActor::SetActorRotation
are reliable always executed on the recipient pc in the same order, no matter in which order the packets arrive?
ok so I can call event KillTroll(), then ReviveTroll(), reliably, but it might very well happen that ReviveTroll() is executed first, then KillTroll()?
are you sure on this? I tried to find it in the documentation but didnt manage to
Yes thats correct.
RPCs are fire and forget. You cannot rely on them executing in the order you sent them.
Probably not, you are better off reading the engine source code.
@fossil spoke ok, then I need a bit more code, but thanks
but good that I asked, because I was just about to assume that order is in fact guaranteed
@uncut oracle some time since I read that code, when are the packets sent?
have you tried reading the source code?
I think I actually never looked at that part of the netcode
have you looked at IPNetDriver::TickDispatch as well?
also there is ProcessConnectionlessPacket
But not sure what exactly that is
If I have a replicated TArray, and also a multicast RPC that modifies that array, then will they result in conflict? Will there be 2 modifications to the array, when the RPC is called?
Basically server replication and client's own modification will conflict each other?
yes
and resizing the array on the client is completely taboo
that will straight up break the replication
Good to know let me not do that ๐๐ฝ
Say an actor has a UObject property. If the UObject gets added to a TArray somewhere else, and the actor then gets destroyed, should I use Rename to set a new outer for the UObject?
really need help guys, for some reason VOIP is showing that the 1 person thats speaking is someone else, this is the same code i use for my chat system, which works perfectly, but for voip not so much. How can i call a players steam username properly
@snow cliff @fossil spoke FYI I believe reliable RPCs called from the same actor are guaranteed for order
Are you sure?
have never verified personally. going on various google results and messages mostly from zeblote and jamsh.
reliable bunches sent in the same channel are guaranteed ordered
each actor sends reliable rpcs in its own channel
so you get ordering between them, but no ordering between multiple actors
btw, there is a catch
I'm wondering if there's some edge case that could occur where a 2nd RPC is sent before ack for the 1st RPC is returned - like I'm guessing order would only be maintained if e.g. two RPCs are called in the same frame?
if your client is lagging for around a few seconds, the engine will clear your view target, which temporarily results in all actors being not relevant to your connection, which results in reliable rpcs being dropped (I've just commented out the seemingly pointless code that does this to fix the issue)
queued reliable bunches are guaranteed delivered and ordered
regardless of what frame they were sent in
it has a resend queue per channel on the server, and a reorder buffer on the client
if you send too many reliable rpcs at once and fill the resend queue, the client is disconnected
ah, like if the other side receives bunches tagged 1,2,3,5,6,7 it will realize "hey I never got 4 I gotta wait"
simple enough in laymans terms
yeah basically
what actually happens is it receives and acks 1-3,5-7, processes 1-3, the server receives the ack mask and notices the missing 4, resends it, client receives it, immediately processes 4-7
the resend queue fits something around 200 bunches if I remember right
btw, unreliable packets also get acked
so the server theoretically knows if they were received
but this info never leaves the low level stuff
it's how it knows when to resend a replicated property delta that was put in an unreliable bunch
(if there were no acks on replication, it would have to periodically resend all properties that were ever changed "just in case", so clearly we can't have that)
If your client is lagging for around a few seconds, the engine will clear your view target, which temporarily results in all actors being not relevant to your connection, which results in reliable rpcs being dropped
^This is interesting to me. Does the engine do this in an attempt to reinitialize the connection?
Anyone have any idea how to handle networking errors in C++? Specifically connecting and traveling errors. I haven't been able to find delegates to bind to or methods to override anywhere. I did find HandleNetworkError and HandleTravelError in C++, but they are specifically for Blueprint. I also found events in GEngine, OnNetworkFailure() and OnTravelFailure, but neither of them get called when a network error occurs, at least a connection timeout error.
The GEngine ones are the ones to use. The BP events bind to those as well.
Is there a way to hide a specified client for an other client?
@twin juniper either SetOwnerOnlySee(true) if you want to hide your own client pawn/character for all other clients or if you want a specific one, do a Server / Client call on a player state that you want to turn off and pass in your own pawn and call OtherPawn->SetVisibility(false) on the specified Client function's receiving end
I dont have the Function "SetOwnerOnlySee"
@twin juniper its name is SetOnlyOwnerSee
Ah yea, thank you ๐
That is not working. I am in the Pawn of the Player. Maybe i need to manually refresh it?
Ive tried to other way but i can only make myself invisible, not for other clients
it looks that executing from my character pawn a RPC Event Call, it doesnt get multicast to the other clients ๐ฎ But the Pawn is visible for the others? Why it doesnt work?
@plush wave I don't know. it just does, with no comment, for seemingly no reason. nothing breaks by commenting out that code and having your reliable rpcs actually work
Anyone have a solution for launching a dedicated server from visual studio? Normally I have to run the .exe then attach the debugger, but it's crashing so early I haven't got a chance to do so.
It's all been built and cooked
I was trying to do that aswell, configuring vs to launch it seemed super annoying so I just used that "entrian attach" extension which can instantly attach the debugger to processes being launched externally, works great
maybe there's other ways
10-day trial... that'll do me for now
Damn, that works annoyingly well. Hell I may just buy that
@twin juniper Multicast can only be called from server. You need to RPC to server then Multicast to everyone. 2 calls.
What is triggering this Multicast? Is it from player input or something else?
Hi so something that has me has my hair tearing out. I have a debug version of my game that i upload to steam and some unreliable rpcs that work fine. i then create a shipping and/or test build and i upload that and my rpcs don't seem to be being called
Any help would be great i really don't even know where to start with this.
Im using SetActorRotation and it is reflected on all clients(left window) but not on the local client that triggers the rotation (right window) what can I do
@dark edge triggered by a Pawn
Hey everyone I have a weird problem with getting in vehicles in multiplayer
The blueprint is pretty simpl
On begin overlap> check if occupied bool> let the controller know that it can get in
And when I get in the vehicle the bool Occupied is set to true
But other players still can get in for some reason
Long story short I can't make the Occupied bool change so other players would see it changed too
Can I host an online game server for free?
Because photon provide that ability for few ccu.
can I have someone connect to a listen server through the internet in a development build?
simple as going open mapname?listen
if i recall ive done it but im not 100% sure. make sure ports are open, the other pc that connected was using a packaged version
alright, I'll give it my best shot
@twin juniper No i mean is input triggering it or some other event?
@twin juniper Forward ports and you can do it from the editor or any other way
Hello, I'm creating a dedicated project,
I would like to start the server with a command and connect client with ip, any idea on how to do this
@idle flame You just..... do exactly what you just said. Fire up the server and connect from a client.
Yes but i need to forward it to server and then using multicast
@uncut oracle I think if you put a breakpoint on StatelessConnectHandlerComponent::Outgoing you'll see where everything is coming from.
@dark edge I've create a server with the -server flag, but it don't work
@dark edge It doesn't start the server with only a terminal
@idle flame just check on start if it is a dedicated server and create a server then
@twin juniper how can I check if it's a dedicated server ?
I've compile the project, so I have a .exe and when I start the server with : game.exe -server -log, and this is not working
There is a function โisDedicatedServerโ
@idle flame This is what works for me.
"C:\Program Files\Epic Games\UE_4.20\Engine\Binaries\Win64\UE4Editor.exe" "%CD%\ShotInTheDark.uproject" TestMap -server -log -nosteam
so -server -log at a minumum for you I'd think
That's for firing up a dedicated server for testing. For deployment you'll want to follow the cooking and building for dedicated servers guide.
Hey multiplayer people, I've got dedicated UE4 servers running in AWS behind a network load balancer. The way it works at the moment, there's a service that listens for UDP traffic and when a new endpoint is discovered, it sends the player to a server that has room for another player. That service proxies the traffic between the players and the servers. What I need to do next is support matchmaking so that the right players go to the right servers. In an attempt to do this, I followed the lead of OnlineAuthHandlerSteam and wrote a packet handler that sends a player Id so that when UDP traffic lands on the load balancer, I can know which UE4 server to send it to (by parsing the data directly). The problem is that the handshake packets from the auth handler come after the StatelessConnectHandlerComponent handshake. The only thing the network load balancer has to go on is source/dest ip:port, so I need to get my identifying data sent right up front. Is there a way to send data on the connection before the StatelessConnectHandlerComponent handshake? Do I have to modify StatelessConnectHandlerComponent? I'd really rather add plugin functionality than start changing the engine code.
@uncut oracle It looked to me like all the handshake data and game packets were all going out through that Outgoing function. To figure out what's sending it, you need to look at the sender rather that the receiver. Maybe I'm missing something.
im looking through the engine code (not built from source) and im slowly putting parts together, but what im wondering is how does UE4 serialize classes/structs/variables and such to be sent over the network and rebuilt such as sent from client to server? im looking for the code that takes care of all that to try and learn from it
nvm partially found it in the serialization section. an explanation from someone else that knows wouldnt hurt either
read NetSerialization.h
In general, do you guys consider leveraging RepNotify extensively to be good practice?
I like designing around state and state changes so it's my natural approach.
Over a multicast? sure
Multicasts are for One time events that happens, and never care about again
OnRep/RepNotifies for "states" of actor.
IE: Particle and effect of a Chest opening == Multicast. Chest being opened/closed == RepNotify/OnRep
once push model is ready having giant amounts of rarely changing replicated state will also be very efficient
@fleet raven https://www.networknext.com/
network next doesn't work with player hosted servers, they require you to run dedicated in specific data centers
Getting to the last bit of making my inventory system networked, but stuck on this one. I posted on Reddit but hasn't got it resolved. Can anyone help out?
So all the internal inventory logic, like picking up and dropping items, is working with multiplayer. But when a character equips a weapon, it always appears smooth on listen-server, but jitters big time on client, regardless of who's controlling it. The video shows this: https://vimeo.com/398196936. Listen-server is on the left, client is on the right.
On client-side, character seems to keep jumping to something.
Here's the code that makes character equip a weapon item, by attaching the weapon to a socket on character's skeletal mesh. The code is in the character's class.
ItemToEquip->SetActorEnableCollision( false );
ItemToEquip->AttachToComponent( GetMesh(), FAttachmentTransformRules::SnapToTargetIncludingScale, "RightHandSocket" );
This is "Equip jitter" by Freeman Makes Games on Vimeo, the home for high quality videos and the people who love them.
General direction like what should I look at and study is also greatly appreciated..!
just seems like you accidentally got collision enabled on your weapon and it's exploding the character movement on the client
In the equip function, which is a server RPC, I have the line:
ItemToEquip->SetActorEnableCollision( false );
To explicitly disable the collision. But it looks like the collision is still active on client?
Maybe the disable of collision isn't replicated to client?
How can I replicate this disable of collision?
It looks like SetActorEnableCollision changes the bActorEnableCollision in the Actor class. But I don't think I should set that variable to "Replicated"?
have something that runs on the client when you attach the weapon
could be an onrep variable or whatever
Do you mean to make an extra replicated variable, and in its RepNotify function, disable item's collision?
that would work
Let me try now!
@fleet raven Wow, that worked on first try! Amazing.Thanks for the help! You've helped solve quite some problems of this project of mine, and I believe that's the last major one.
nice
If you have the time, can you explain why a net multicast approach I tried earlier didn't work? So there's a server RPC equip function, which just calls a net multicast RPC. The multicast RPC does all the actual equip logic, including disablling the collision as well. But client still jittered.
did you make sure it actually arrive on the client?
Hmm, I didn't. Yeah, maybe I should've set a breakpoint in VS.
Not gonna revert to that version of code though. Scared o_o
But is this approach of extra replicated variable a best one? I mean, it looks like for every un-replicated variable in the engine code, if I want to replicate it, I need to add and maintain such a new replicated variable?
if they didn't replicate something, you'd have to do that yeah
also consider whether something is state or a one time event
late joining clients will receive the current state of all replicated variables, they will not receive prior rpcs
Good points. And yeah, that's a good consideration. I also remember reading a discussion here on that: https://forums.unrealengine.com/development-discussion/c-gameplay-programming/25318-onrep-vs-multicast
Thanks again ๐๐ฝ
with push model coming up it'll be no issue to have tens of thousands of unchanging replicated variables
(honestly don't get why that isn't how it was designed from the beginning, but well, better late than never)
I've never heard of the push model. Even search engines don't return many results on that o_o
But I do remember push/pull being a software design thing.
Hello guys, I've one question about sof references. What if I load a soft class on the server and then spawn a replicated actor? Is the class automatically resolved on clients if it's not already in memory or should I provide a system to load the references in memory on both server and client before spawn?
it should load sync, but not sure, its not too hard to test
Yeah it's resolved / loaded automatically
When you rep an actor for the first time either the acked class GUID is sent along with it, or the full FName of the class if not.
Thanks guys. I asked because I can't test at the moment on a remote machine and when testing in PIE if I'm not wrong the references are loaded one time for both server and client
not if you uncheck use single process
in advanced play options
then a standalone instance gets launched and connects to the PIE one
and you can choose which instance you get to run in PIE, server/client
cool @winged badger! I will test it, thanks
I don't suppose anybody has been able to test running a Steam dedicated Server on a machine, then connecting to it as a client on the same machine?
Server works fine connecting across two different PC's, but on the same PC it immediately drops the connection. My guess is Steam doesn't like it, wonder if there's a way around it.
Damn. Thought as much. Okay third PC it is ๐ฆ
IIRC there is a way to do it, Steam doesn't like you having more than 1 open session per local ip regardless afaik
But I managed to find a workaround last time I was developing for steam using UWorks
I think it was using this
But it was ages ago, maybe 2-3 years ago so I can't really remember
Thanks, I've got it hooked up with three PC's now but I'll try that next time
No woz
Hi all, for some reason my clients appear to be lazy loading Data assets rather than loading them instantly.
For context I follow a similar method to the ActionRPG example (although I now regret it a little)
My Server has weapons that are spawned on Begin Play from classes referenced by a UPrimaryDataAsset subtype.
The Data Asset is then force loaded by the Asset Manager and the weapon is spawned based on the referenced blueprint class.
The weapon appears instantly on the server, however each client then appears to load each of these weapons in it's own time (anywhere from 3 to 6 seconds).
This delay is causing some issues and I'm really not sure why it's occurring. It seems like the client's are lazy loading before then resolving a GUID.
Has anyone else come across similar issues or can help me with a solution?
Quick question
How do you detect that everyone has finished loading/travelling after doing a server travel?
I want to make sure everyone is loaded after travelling from lobby to arena before starting the match
send an rpc to the server from every client as they finish loading
@slate veldt it doesn't seem like anything is preloading the asset on the client side. if you don't, replicating a reference to an asset will use network async loading, which can have a slight delay
that said, 3-6 seconds to load a simple data asset sounds ridiculous, so maybe more is happening here
Hi everyone! I'm having some issues and I can't wrap my head around why they are happening... I have a chain of events:
Client requests data -> Server receives data and waits for other components -> All components ready, data gets processed on the server -> Server sends back some specific data to the client
Client receives that data around 30% of the time
How can an RPC to the client fail if it was the client who initialized it?
Is there something that is triggered when loading is finished after server travel?
Does EventBeginPlay work?
@fleet raven That's what I was thinking - as there is only a small number of variants at the moment, I was considering just loading them all on begin play on the client and then the resolving GUID should happen much quicker
Also yes it sounds absolutely ridiculous, I have no idea why it's taking so long. It's literally an asset with a few simple types (float, gameplay tag etc.) and then a reference to a blueprint actor class which is literally a static mesh and collision box. Really routine simple stuff!
I'll see if I can pre-load them in anticipation
@fleet raven push model ? where can i read up on this upcoming change?
Hey guys, I'm making a mobile fps shooter and I was wondering what is the best way to host servers. I've already managed to make my own pc a dedicated server but I can't find any documentation to for example make a server browser. Would Amazon Game lyft be a good option?
@tardy orchid If I understand you correctly you're looking for a way to host authorative servers yourself? Generally you have two ways of going forwards, if you want to keep costs low, you can have a small 'matchmaking' server to handle communications between clients, and have one player be selected to host for the game. Or you can use your own servers, (like AWS gamelift). Though you will want to keep an eye on pricing on those, as they can get quite expensive quite quickly.
Ok and if I also want to keep track of which account is what level and has how much coins, what would be the best way to take care of that
For that you'd probably want to use some database, https://www.unrealengine.com/marketplace/en-US/product/postgresql-integration, most will have a plugin
If you go with AWS there's managed solutions there for most common types of db
Oh yeah that's the keyword I was looking for Database, thanks I'll look into it
It might take a little bit of learning to get up to speed so I'd recommend looking at a tutorial on the db to get a little more context as to whats going on.
I trying to do some replication and I have a general question. I have a weapon class with a Fire-function, which is triggered with a InputFire-function in the character class. Do I only need a server fire-function in my Character class, that triggers the Fire-function on the weapon? Or do I need to set up server functions on both character and weapon?
For single player games, the default ENetRole of an actor is ROLE_None or ROLE_Authority?
Why do I get: Unrecognized type 'void' - type must be a UCLASS, USTRUCT or UENUM
UPROPERTY(Server, Reliable, WithValidation)
void ServerFire();
this is my code for spawning the player's HUD when they're spawned into the game, and is called on beginplay for the character. For some reason the first client in spot 0 always has more than one HUD attached to them. I tried making sure that the player controller was the correct number but it still duplicated it on player 0. Any ideas?
@sand tangle UPROPERTY ??
@cerulean escarp dont use PlayerController 0, unless you understand what i means. And this is on the local lcient only right?
@meager spade omg, thanks.
@meager spade yes it should only be on the local client
Is there a book / course / tutorial that explains everything within UE4 replication?
@cerulean escarp I would put all UMG related code in a AHUD class. It's only present on the local client so when the widgets are spawned you don't have to filter the controller, you can just use player controller 0
Does anyone know why Ping * 4.f would be different on Client B than ExactPing is on Client A? The replicated ping looks to be around 18ms higher than ExactPing.
// Calculate the average, and divide it by 4 to optimize replication
ExactPing = (Count > 0 ? ((float)Sum / (float)Count) : 0.f);
if (bShouldUpdateReplicatedPing || !HasAuthority())
{
Ping = FMath::Min(255, (int32)(ExactPing * 0.25f));
}
I only see an error of < 4ms here
thank you! @oak hill
I had a question Im almost finished implamenting the muliplayer the max players that can join is 4 however I atn 1 player controlled Enemey to also have the potential of joining the game so would I need to set the max players to 5 or set the PCE as a seperate join value?
How do I edit the predictive movement on the client-side for non-local characters? When I have a unit moving on the server and it suddenly stops, you can see that it sometimes jerks back. Like in the screenshot I'm moving left on the server and when I stop it moves back one move?
@feral grotto https://eeldev.com/index.php/steamcore-dedicated-server/
@jolly siren no guarantee those are sent in the same frame i think
Hi, for don't replicate specify variable in the struct is with the NotReplicated ?
Thanks Zlo, that's what I was thinking too
@twin juniper Yes, you mark it was NotReplicated if you need it to be a uproperty
ok, and the ReplicatedUsingwork in struct?
Is there any build in console command to display the IP of the server i'm connected to as a client?
once the build is done, that is
kind of like a version of "stat net" that shows additional info
ReplicatedUsing works for the struct as a whole
ok thanks
np
Really should not be getting a world in a struct
If you need world access maybe consider making it a uobject
its fine for member structs that have a weak pointer to owner
in odd cases, sure, but general rule, should not really access world from a struct
Why are level blueprints replicating by default?
Normally you would want level-wide events or properties to be replicated no?
Can anyone explain why this would spawn an actor twice on client-side?
server also execute multicast, maybe thats why it run twice to spawn 2 guys
So the server proxy on client-side spawns the cable?
should not use Multicast to spawn an actor unless it only client side
Server should spawn it replicated
@meager spade Thank you! Makes more sense now, it works now ๐
Hello everybody. I was hoping someone could point me in a general direction. I am creating a multiplayer game.
I wanted to have a player HUD that changed depending on what the player has done. For example if the player had Hosted or Joined a game, etc.
I created a variable in a custom PlayerState, but this state seems to reset each time the player loads a new level.
Is there a best practice regarding maintaining a custom player state (enum) that persists with the player between levels?
TIA.
Still trying to get the hang of map travel, is there a reason why a Server travelling to a new map with players in the game would not call any of OnPostLogin or OnSwapPlayerControllers when the players reach the server?
@next fable GameInstance is one of the only thing that doesn't get destroyed when you travel to a new map. Try putting it in there or otherwise, you have to flag the PlayerState as persistant
@glass plaza Thanks
Hey everyone, quick problem, I'm making a multiplayer fps with tanks and when someone gets in a tank other players can still get in it, I have a bool IsOccupied and I've set it to replicated but other players always see it as false ( the player that gets in can see that the bool changed )
Hi, i want to replicate ActorComponent only to the owner of this Component. I mean, i only want to replicate the inventory to the client who owned of this character, not other clients
@tardy orchid Was the value changed on the server ?
yes I tried a custom event to run on server but it still didn't work
to change the value
but far as I know I don't have to change replicated variables on the server
and still this photo example above should work
Yes, you do have to change it on the server
Replication is strictly server - to - clients
Player Controllers are also not replicated to other clients
Hard to say more without more code
Anyone who makes a successful dedicated server with steam that can answer some questions please?
just ask and if someone knows the answer they will respond
@viscid escarp you can also try shootergame or generic shooter i think both has basic setup for working with oss/steam. there are many tutorials as well you can follow along.
@unique kelp is not an easy problem. I followed dozens tutorials and pages, already contacted the Steam Support, asked for help here and nothing works. But, here we go again: when i start the server, the steam INTERNET tab is not showing my server in the list. Seems like is a steam master server issue. Also, i can't "find sessions".
@rotund sapphire i'll try that thanks
i think you can run server at home but you cant connect. Instead, you must upload and run the server in cloud (or another pc from other network)
Already tried. Didn't work.
Hi, i want replicate ActorComponent (Inventory) of my Character only to the Client owner of the character.
I mean... if we have 5 clients, with 5 differents clients, if 1 character add item to his character, only replicate the inventory component to the client of the character
what?
for now my actor component replicate for all clients
and this is what i don't want
only want replicate the component to the client of the character
if your character replicates, all components will replicate with it
if you need it specific to that player, why not shove it on the PlayerController?
its server and local player only
or make a Inventory Actor and set it to Replicates owner only.
Am I able to put a MySQL database on a VM or VPS so i'm not limited to the amount of queries i can do?
why not set inventory properties in the component to cond_ownerOnly ??
@bitter oriole well I tried changing the variable on server but it didn't change at all and if I set the RPC to not be replicated or multicast or run on owning client, the (SomeoneIn) changed variable is only visible to the player that got in
Problem stays the same, if I get in a tank, other players can still get in which messes up everything
A fellow who spent three days trying to get character selection working with no avail
I've followed the Blueprint Multiplayer tutorials on Youtube from Epic
Up until this episode
Here we continue with our Character Select screen and provide the functionality for selecting and assigning the selected character for our server/clients. We also make sure that the same character cannot be selected, so we need to communicate that from the server to all client...
I don't like how he's hardcoding character selection, so I opted to create my own dynamic version, however the characters only appear on the server, not reflected on the client
First part of blueprint
Second part of blueprint
This is a widget blueprint called CharacterSelect, what it does is it loops through an array of characters class and creates a button for each character inside the said Widget
however, this code only shows the characters on the server (Host), on the client it displays and empty window
I have played around with the code, moved it to LobbyPC (which is the player controller assigned to users who connect to the game), moved it to LobbyGM (which is the lobby Game Mode)
played with variables, made them replicated, made the functions replicated to no avail
any hints, tips, or resources i can use would be much appreciated
well, the stuff has to be replicated