#multiplayer
1 messages · Page 542 of 1
looks perfect 👌
I am calling a server function, thats disabled CharacterMovementComponent via SetComponentTickEnabled(false) in multicasting it to all clients. Animation stop ticking and updating at listen server. Animation Graph just stopped its update. How do I force update it? Its very easy to reproduce in standard Epics TPS template by this code.
My goal is to make anim graph updated when CharacterMovementComponent is not ticking.
why are you not ticking the CMC?
is there a reason why
and if you do disable the CMC tick, the skeleton will never tick, cause the CMC ticks it.
@meager spade why only on server? "why are you not ticking the CMC?" strongly required
clients anim graphs continue update
i don't really understand why you need to disable CMC tick tho
seems a bit strange
just set movement mode to none
and nothing will update.. 🤷
@meager spade dude, thanks a lot. I will try your solution. I need to disable CMC because of becoming a car passenger and if I didn't disable CMC some jittering will arise at client.
@meager spade works just fine in blank project. Trying to use it in real battle field. Thanks you very much!
Hi all. I have been working on a MOBA/RTS style click-to-move character movement and I want it to utilize network prediction available in the Character Movement Component.
My approach was to enable client-side navmeshes and calculate the path on client. Follow the path on client side by translating into vector move inputs every tick and sending those to the server.
I was able to get a simple implementation working in Blueprints using the Find Path To Location Synchronously node and a Pawn->AddMovementInput node.
This approach actually worked perfectly under simulated lag, but there are obviously tons of edge cases to handle for the path following aspects. My character would bug out around path point transitions and reaching the end goal. It doesn't handle path updates. It doesn't do any avoidance. Therefore, I was digging into the AIController MoveToLocation C++ code and seeing if I could lift some existing code to do this for me.
I found the PathFollowingComponent handled all of this already, so my next approach was to make PlayerController subclass that had a PathFollowingComponent like the AIController does. I copypasta'd enough AIController code until I could call PathFollowingComponent->RequestMove(MoveRequest, Path);
This works as far as getting the path, but for some reason doesn't replicate the input correctly to the server and I can't figure out why.
What I'm seeing with the C++ version is the client gets a path and does a local movement input correctly on that first frame, but nothing on server. So its a giant jitter loop as client keeps getting reset to initial position.
I traced both Pawn->AddMovementInput() and PathFollowingComponent->RequestMove() down to the Pawn->Internal_AddMovementInput() call. Obviously the PFC has a more complicated codepath to get there, but this seems to be the common denominator.
Is Pawn->Internal_AddMovementInput() not always replicated to the server?
I see in CMC TickComponent() the input is consumed by const FVector InputVector = ConsumeInputVector(); So it shouldn't matter how it gets there.
I think I will make a custom subclass of CMC and see what it reads for that vector. but Im 99% sure its being populated since I am seeing at least one frame of input happening before being reset / corrected by the server
@barren patrol the Pawn being moved client side has to have ROLE_AutonomousProxy
you also need a few alterations to CMC, where it does Cast to PC, and such, if your Pawn is possessed by AIController
but it is doable, pathing clientside that routes to CMC's AddMovementInput on its own
all the functions are virtual, so its not that hard
there is also plenty of stuff to reroute in APlayerController::TickActor
@winged badger I ended up adding a PathFollowingComponent to a custom subclass of PlayerController possessing my character. So its not an AIController, but I copied a bunch of code out of AIController to implement a PlayerController version of it's MoveToLocation()
If I am able to call the blueprints node for Pawn->AddMovementInput on my character and that works as expected without the infinite correction loop, does that mean I have the ROLE_AutonomousProxy set up correctly? I think i did the spawning/possession right for that.
if you added pathfollowing to a PC, then its fine, provided you didn't break it
PlayerController:TickActor is something I haven't looked at yet. That looks like a bunch of ROLE stuff that could be relevant.
as that is the default behavior for a PC possessed pawn
we got it working with AIController between PC and the PlayerPawn
and PC's pawn is basically camera
i saw that approach as well. does it use an RPC to replicate the click to server and run the logic there?
i noticed some restriction on AIController being on clients.
no, its moves locally just fine
via AddMovementInput ultimately
this way bots get to share the AIController code
and PC only has player at the wheel specific logic
that is nice actually.
as a newbie i don't know how much i like the controller/pawn abstraction. it makes it hard to reuse logic between players and bots like you said. im tempted to push this into a MoveToLocation / MoveToActor function on the Character class itself.
its all on same principle
if you tell the Pawn to shoot at target
it doesn't care about how that target was selected
AIController base class has GetTargetedLocation() function
the human player's will override to deproject mouse to screen, trace whats under mouse... etc
the AI will just return the location of its TargetActor, which the BT will attach to whatever it wants to shoot at
Pawn only knows that GetTargetedLocation function exists
don't get me wrong, I would use a thin layer of separation between input and character for sure. but for movement, it seems like the MoveToLocation pathfinding of AIController could have easily been part of the Character / Pawn instead. Then, as in your example, PlayerController and AIController could set the target move location differently but get the same result.
the entire thing is pretty unfortunate atm
CMC is 13k lines monolithic monstrosity
tightly coupled to ACharacter and APlayerController
in general, works more or less fine unless you want something other then the common functionality
haha, so it seems
@meager spade it's not work.
@winged badger can u suggest me how do I can disable cmc tick and wants my mesh to play animation on listen server?
does the warning "no owning connection for X, function Y will not be processed" refer to the present situation or future shipping builds? while testing the development build everything the warnings refer to seems to be working, and the events are called from a pawn that's possessed by a player controller
Hi, if i want to make a dedicated server, what should i install in the server and how should i connect the server to ue4 ????
Can anyone tell me how to test a dedicated server in UE 4.25?
In the previous versions there was a checkmark to run dedicated but not anymore.
The docs are old, 4.9..
https://docs.unrealengine.com/en-US/Gameplay/HowTo/Networking/TestMultiplayer/index.html
The screenshot is 4.25 as I have it here.
Set up the Unreal Editor for testing multiplayer games.
Does anyone know if there is anyone to override an steam tools appid? i have created a dedicated server as a steam tool associated to my main game, but when I execute it from my steam library, the server doesnt work (it works if i execute the .exe directly)
Hi 🙂 In my Shipping build, the Steam Friends functions do not work (I can't see my friends list) whereas in Development build this works. Does anyone know why? Am I meant to set up the Shipping build differently?
@dry turret that probably means all instances of that Pawn, even ones that are simulated proxy are trying to send the RPC
If I were to set up a TeamState BP how would I go about doing so?
make a actor derirved from AInfo
then in C++ make it relevant only to players of the same team
if only the team can access/see it
(this does not affect server, just other teams)
does inviting someone off the friends list on steam trigger anything in engine?
I'm trying to decide on how to do my invite system
@meager spade Resolved
How and where can make a replicated widget?
I need after a time appear a widget to all.
Yes @buoyant wedge
i kinda managed to have optimized networked ragdolls... if anyone is interested let me know
Widgets are not replicated @buoyant wedge
All widgets are local
You can send an rpc to all clients to show a widget
But they have to make it and display it locally themselves
@jovial cipher if you use the advanced sessions plugin you can have the invite event on your GI iirc
@jovial cipher yes it does
Even works if you use uworks
We also handle invites where the receiver has not got the game running
They load the game and try to join the session of the invite
Automatically
i have the same behavior but i didn’t have to do anything about it again iirc
with steam and advanced sessions that is
Well steam launches the game and sends in the lobby id
yes
Advanced sessions probably handles that under the hood
probably
that ragdoll doesn't seem to sync up on the different screens
Meh I never care for synching visuals like that
@fleet raven that’s the optimized part. I only need the position, not every bone.
If s ragdoll looks different to another player who cares its o lyrics visual
Its only
^ this
If it was a gameplay element then sure
it matters if they're like "wtf look at this epic pose" and their friend is like "huh?"
duh
Yeah but that's common I most gsmes
I have seen my ragdoll In weird poses and others see me different
the gameplay i need here is the ability to revive a dead team mate, so the position is very relevant
I dont ragdoll
I just play a downed animation
And keep them in it
Whilst they are still alive
Down but not out
yeah if you have flat land that’s ok
how do you transition to the downed part
When your down they just shove you in a downed pose
Happens so quickly you dont even see what happened
hum
Take a look at some fortnite gameplay
You will see
It's all smoke and mirrors a lot of things
what, blend at 0.2 seconds to downed?
🙂
yeah smoke and mirrors is pretty much game development eheh
i will look into that option as well
Ragdoll is fine if the player is dead and gonna be respawned
but i was into deep this task... so wanted to experiment
Not so great for DBNO
dbno?
Down but not out
Yeah
hum
well indeed..
most do
i have a couple of downed poses from mixamo, but none is great
couldn’t find any
anyway... i left that there so if anyone needs help i can try helping.
yeah indeed lol 🙃
Hello guys, can someone point me to a source were is the process of set up the game, build, run it on 2 machines and connect the players? I mean this is the part were I'm stuck, i have no idea how the player form Africa will connect with the one in UK
Anyone who have made there game with unreal engine and uploaded it on steam?
I needed some help
Hey Unreal Friends :).
I've developed a third person sports game over the last weeks. I am stuck on network testing.
I've built a binary and shared it with a friend and my brother. I initiated a session as a listening server.
But neither of my clients can connect. They get a ConnectionTimeout:
"LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionTimeout, ErrorString = UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 60.01, Real: 60.01, Good: 60.01, DriverTime: 60.01, Threshold: 60.00, [UNetConnection] RemoteAddr: my-ip:7777, Name: IpConnection_2147482587, Driver: PendingNetDriver IpNetDriver_2147482588, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID, Driver = PendingNetDriver IpNetDriver_2147482588
[2020.05.17-14.42.50:103][252]LogNet: Warning: Network Failure: PendingNetDriver[ConnectionTimeout]: UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 60.01, Real: 60.01, Good: 60.01, DriverTime: 60.01, Threshold: 60.00, [UNetConnection] RemoteAddr: my-ip:7777, Name: IpConnection_2147482587, Driver: PendingNetDriver IpNetDriver_2147482588, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID" (From the LOG)"
My Log of the listening server does not show any sign of an attempted connection. So it fails on the client side completely.
I am standing in the dark right now. Can someone point me in a direction?
Note: I have forwarded my Port on the Router for port "7777" to my local machine, but nothing...
Are you blocking the connection in firewall maybe? I remember having to change my firewall setting to have both private and public network allowed once to make friends be able to join properly, even after portforwarding @primal pike
@cyan current Yes, I created a rule specifically for UE4, UE4Editor and BootstrapWathever(the one for the binary executable).
@covert oriole https://docs.unrealengine.com/en-US/Gameplay/Networking/Server/index.html You need to run the client and enter certain commands in the command line ingame or run the game from the terminal with the same commands appended. One needs to host the game as a server (listen server to be exact) and one needs to connect to the ip of the host.
An overview of the role of the server in multiplayer.
Anyone who have made there game with unreal engine and uploaded it on steam?
I needed some help
@meager spade ok. I fixed the widget problem and implement a HUD. But when I try to remove all widget to all player.. The widget persist on server/player. Any idea?
@dense atlas I have set steam for steam upload and make the page for download the test on my friends, but really basic
hey everyone, did any of you managed to figure out the Package contains EditorOnly data error when running the dedicated server?
The relevant error being
[2020.05.17-18.45.26:570][ 0]LogLinker: Warning: Unable to load package (../../../../../Epic Games/Ue4Source/Engine/Content/Animation/DefaultAnimCurveCompressionSettings.uasset). Package contains EditorOnly data which is not supported by the current build.
Assertion failed: !GEventDrivenLoaderEnabled || LoadPhase > ELoadPhase::WaitingForHeader [File:D:/Epic Games/Ue4Source/Engine/Source/Runtime/CoreUObject/Private/Serialization/AsyncLoading.cpp] [Line: 7288]
any tip or trick would be appreciated 🙂
@winged badger thanks for help yesterday. i attached the debugger and realized i needed bUseAccelerationForPathfinding to trigger the right codepath... now works perfectly!
this engine is quite the learning curve. not the first time i have spent 4+ hours debugging, only to find a checkbox i need to tick 🤦♂️
This was my input for dropping a sword. This worked yesterday on both the client and server yesterday but for some reason, the client still "shows" an outline of the a sword in its hand like it isnt being replicated (replicates is on) and you cant use it. both events are "run on server"https://blueprintue.com/blueprint/k5_q_unq/
What would be a good way to go about spawning projectiles in a multiplayer project?
I had one setup as a multicast but this I didnt see to be the best. i.e if the player hits their own projectile by accadent somhow on their side but not on the server it destroys the actor on their end but not the server.
what would be a better way to do this
Does the Ability System work with networking?
@plush lagoon yes
oh nice. :3 Thank you, I remember being told at one point a while ago, it didn't work. So I have not been able to check back into this topic since then Xd thank you
I’ve read that Clients can’t use the Game Mode, it only runs on the Server. But can Clients get info from the Game Mode and set variables within themselves based off the Game Mode’s information? Such as taking a “Game Type” (Deathmatch, King of the Hill, etc.) and setting a “Game Type” variable within itself to use for various in game mechanics and how to handle them?
@ionic mountain from my handling its GameMode -> Player Controller (Server) -> Player Controller (Client)
so you can pass informaiton to the client for the player controller to handle
but it happens on the server's player controller
not the clients
then you replicate it from the player's controller on the server too your client player controller :x
Hm, trying to figure out how I would use this with abilities. In one game mode your primary skills have 1x play rate, but in another have 3x play rate. I need to figure out how to get this info to the player.
I think I figured it out. On begin play the client will run an event on the server with an input pin of the “PlayerBP” which will then use that input (as the server) to set the Replicated “Game Type” variable as the server.
Does anyone have experience with AdvancedSteamSessions Plugin? I created a dedicated server tool to for my game but when I launch it it forces the wrong app id(server app id instead of game app id). Making the appId.txt file readonly doesn't work unfortunately 
I doubt there's an answer for this I'll like but, there's no server travel for PIE, right?
Is there any way people have run multiple versions of Unreal on the same machine, successfully testing standalone multiplayer games?
you can use command line arguments to run a listen server
An overview of the role of the server in multiplayer.
I wrote a bunch of .bat files myself to launch instances of the game (uncooked, unpackaged), one being a listen host and the other a client, on the left/right sides of my screen. I can share it all if you want, though it's got a ton of gobbledygook variables
I'll accept any resources. At the worst I'll just not use them? 🙂 I'll look at the CLI as well
Right now I'm just getting into the basics, and trying to be able to test. It looks like my multiplayer code -does- work as is, but I still can't get ServerTravel to work (heh)
I'm trying to network dropping a sword. This worked yesterday on both the client and server yesterday but for some reason, the client still "shows" an outline of the a sword in its hand like it isnt being replicated (replicates is on) and you cant use it so the character technically isnt holding a sword. both events are "run on server"https://blueprintue.com/blueprint/k5_q_unq/
@tidal sail a few sample files to set up .BAT files for launching editor game instances (uncooked, unpackaged) https://hastebin.com/ekobohawuf.pl maybe some info in there that helps you try stuff out
Thank you
the last thing I think I have to figure out is how to get UE4Editor.exe to come up in the CLI. I probably have to actually locate it and make it a path variable or something
if you wanted to, yes you could add the folder for the version you're using to your path env var
i didn't bother, used a settings file instead there
you used a settings file in your project?
no for the .bat files... to locate UE4Editor
Ah! Of course. I see it at the top.
there's something i'm unsure about when it comes to programming client-prediction
let's say i want to play a melee attack on a client predictively and then notify the server so it can play it on other clients as well
implementing it like "play animation on client, if this is a client then tell the server to do the same" allows the host to see client animations, but the clients won't see the host or other clients, at least for playing animation montages
so i would assume i have to use a repnotify to notify other clients? at least that's how the shootergame example does it
i see multicast as an option as well but then that wouldn't be predictive
or at least, i don't know how i would skip replicating to the client that instigated the animation in the first place
You can't really predict that.
Unless what you mean is simulation.
Anyways word play, so ... what I usually do is:
LocalClient -> RPC to server that you did an attack, play anim montage. Server -> Set flash byte. NonLocalClient -> Receive flash byte, play anim montage.
can you define flash byte for me
The flash byte can be flagged to skip the owner
Flash byte is just a replicated uint8
What's GAS?
gameplay ability system
Yeah, you can use that if you want.
Hello, I'm trying to setup a server using advanced sessions but it doesn't seem like its working. A listen servers works great with steam and the dedicated server works if steam isn't enabled. But, it seems like it's not connecting to the master server correctly because when I check view servers on steam, it won't show up under lan. Any suggestions would be great. 🙂
Has anyone managed to do pixelstreaming? (Not local) Im having the issue of a client not being able to connect on a open port IP 😒
So I've managed a fairly decent grasp over RPC and Replication lately, but I'm curious about how to handle one thing in particular. Keeping it simple, I want a simple container box that has an inventory in it(Already done), I get how to use the player's input to say.. Open the box and show the inventory, but how would I handle telling the server to transfer items from the box to the player, or from the player to the box? Do I need to put this functionality on a client owned actor like the character? I already have an inventory component that I've created for the likes of characters or containers alike. Can I use this to call server functionality on the server version of the container and then just let the container replicate it's changes? What is the general or preferred way that people handle this?
To keep things contained, and since the Character 'Owns' their own Inventory Container and can call RPC's on it, my advice would be to route all the RPC's through that container. This is psuedo-code, but you would have a couple of functions that allow you to transfer items between them, such as TransferTo(Container, Item) and TransferFrom(Container, Item). These would call RPC's if you aren't the authority, then the server can transfer the items and replication would update the inventories.
If you want to GalaxyBrain it, you can even have the inventory component be the thing that "scans" out in front of the player character to find other objects (e.g, chests), and route RPC's to open and close the chest through that too, just through some generic OpenContainer() function.
Depends on the game ofc, but that's probably how I would do it.
@chrome bay Thanks. I'll keep on this path with that then and see how it turns out using a replicated version of my InventoryComponent. Initial testing shows it working well.
Inventory systems are fun to build tbh, there's so many different ways to do them.
I've done a couple single player ones so far. But I haven't done a whole lot with multiplayer stuff yet. I'm loving this though. I probably wouldn't have had such a hard time with it if I'd have understood what RPC meant. Coming from blueprint, there's no real mention of RPC. So reading docs is confusing for a while. I don't even remember where it was I was reading when I realized it was just an event called differently.
Yeah BP terminology is quite different for some reason, BP often does things CPP doesn't too.
(Like calling OnRep functions on the Server...)
Actually.. that wasn't a half bad idea. Using the component itself for the checking. Now I need to go figure out how to reparent my CPP Inventory version to a scene component instead of an actor component.
You don't necessarily have to use a scene component, I would still keep the inventory as a generic actor comp
Just scan for the actor under the crosshair for example, and check to see if it has any "inventory" components
If it does you can then present that to the UI.. etc etc
How do you generally scan from your actor components? Last time I did something like this it was through a Scene component I attached to the camera on the character. So it just used it's own location for traces and such.
It's up to you really, Pawns have some handy functions you can leverage, such as GetViewLocation and GetBaseAimRotation. With those two alone you have all the info you need to do a simple trace query
I do something similar for my weapon inventories. I have a base 'Hardpoint Component' which is the container component, that has some overrideable functionality for getting the aim location from the owner. (So I have a HardpointComponent_Vehicle and a HardpointComponent_Character)
Hmm. I might need to make a child for the scan and such functionality. I don't think I want to implement that in stuff like crates, or maybe even AI.
Yeah exactly. It depends really, you don't have to add the scanning stuff the the component, you may want to do that separately through a more generic "interaction" system, but it depends on the game
in dedicated server hum much memory a UStaticMeshComponent or components like that take ?
is it good practice to exclude render only components with '#if UE_SERVER' to save a little memory ?
given the assumption I have 5000 of them
Depends. If they are member properties you can't exclude them anyway
The Server will still load that stuff, because for example, you may need to get sockets etc etc.
🤔
during my deep thinking I found its not important and I should not bother myself. my game level is big itself and there are > 50,000 StaticMeshActor by default.
seems there is no way to stop UE4 from draining memory.
🤔
Well the problem is you can't do that really. If the server needs to use that mesh in any capacity, it wouldn't be able to. A good example is if that static mesh has any collision for example.
In open world games that I've made, we usually only load in relevant chunks of the map that players are in.
If you're making a game with a lot of players that they'll be distributed all over the place, I know what we've done is cooked the data for static meshes on servers to strip all of the data that isn't required for static meshes (all polygon data can be stripped for example, as long as you're not using per polygon collision)
@foggy hinge
how did you do that ? changed source or ? Is there any special config or trick to tell the dedicated server to note cook complex collision ?
I need per poly collision only in clients.
Ideally you'll want both the server and client to match collision wise.
my LineTrace for bullets, pickups, and projectiles is done in client. server just verify them.
Server can't verify those if the collision data is different.
Do i need the source code to compile a dedicated server?
Yeah
You can simulate a dedicated server in editor, but to build/package one you need to use a source build
Can i start using the retail version of the engine and then build the dedicated server from the source code version, or do i need to start the project from the source build
You can start from the launcher version sure
But for multiplayer, you should build and test often because the editor is rarely a good example of a real-world environment
Well i'm going to start from the source since i spent all night building it.
I'm mostly going to use non dedicated sessions
Dunno why. I have an i7 6700k
How can I pause game for client??
Also how can I check if there is noone connected .... if game is singleplayer?
Hi
I just came Back to Unreal from 4.19. Updated to 4.25
Did they remove the "Run dedicated Server" checkbox? How do I achieve something like that now?
You can simulate a dedicated server in editor, but to build/package one you need to use a source build
@chrome bay how, if I may ask?
there's a dropbox
@serene meadow
Is it called "play as client now"?
So, it starts the "dedicated server" in the "background"?
But I can't see it in any matter right?
yes, all the players are clients in this mode
Ahhh I see.
I have a slight picture of me being able to see the dedicated server open in 4.19
Thank you.
Is there any way to debug the dedicated server or viewing it's "world". Like a simulated dedicated server, a non headless one with graphics and stuff?
i'm gonna be honest with you, i don't have much experience on dedicated servers so in that i can't help you 😦
That's fine. thanks.
you're welcome
Visual studio will debug all the instances simultaneously if they are sharing the same process (which is the default)
Doesn't the node "Has Authority" determine if you're server vs if you're a client?
Pretty much yes
Though it's more of a "was created on this machine vs was replicated from the server" thing
If I branch with the condition "is dedicated server" is that effificent or should i use has authority? because every time I use has authority, it thinks I am the authority.
It didn't do that with 4.23 and i just upgraded so is that new?
@bitter oriole
I don't believe anything changed. HasAuthority tells you whether this instance of an actor was created on this machine, or elsewhere
Checking if you're on dedicated server would return different result for non-replicated actors, and if you're on listen server
Maybe, It's just if I do a simple check with print strings it thinks i'm both. It'll load the authorly, then it will run client string after
HasAuthority() won't return true if you can call RPC's
It just means the actor was likely created by the Client.
When i start an offline standalone game, it automaticly starts a listengame lol
any idea why and how to turn that off?
Have ?listen in the command line?
It won't start as a listen server unless you tell it to somewhere
not that i know
Or you did something like open MyMapName?listen
Check Run Under One Process
nope, not opened a level or executed something
Check Run Under One Process
still the same 😦
@chrome bay my bad, indeed. I was trying to give a (bad) example on how to use the remote switch. Gonna remove the comment before I confuse someone.
Doesn't look like it's starting a server just looks like it's not running in-editor.
How do you know it's running as a listen Server?
at the start it prints out a message which i have in the PostLogin
Oh
so its like it should be, i just not knew that its still called
but why is "is Server" then true?
Ah.. that node is stupid
It just returns true if the net mode is not NM_Client
You'll be in NM_Standalone
so which node should i use to check if its the server?
Can you get the NetMode in blueprint?
Oh I guess you could use IsStandalone() instead
Ahhh. The joys of multiplayer blueprint
otherwise i need to check if not isStandealone and also if isServer
Unfortunately it doesn't look as though NetMode is exposed to BP
The easiest way would be to make you own BP node
But otherwise, you'll just have to test IsStandalone && !IsServer
(Y)
Can someone tell me what Force Net Update do? Does it flush out all rep variables with changed values to all clients?
Why am I asking, you ask? Because I've got a repnotify variable health, and upon replication I show a killing animation if a player has been killed. So there always is a significant lag in comparison to RPC
It forces the server to check if the replicated properties have changed
is it sane to do a force update if computed health on server == 0?
or should I have an RPC to kill a player
if i mark the "Launch seperate Server" and set the mode to "Play offline"
then it still auto connects to my server...
how to avoid that?
ForceNetUpdate only does something if the actor has a NetUpdateFrequency < server tick rate
i see
would you normally add an RPC on top of the health repnotify variable when a player dies?
I compute all hit effects locally as well as on the server, which works fine if they are normal hits, but on a kill, I wait for that instruction to come from the server
yes, a rpc for death is normal
so on a headshot for instance, there's a lag between the hit and the ragdoll which can be quite perceptible with the onrep var
For example, shootergame has BroadcastDeath multicast
ok then, will use RPC for this instead of the onrep
which also makes sense for a JIP I guess
thank you ethan
JIP?
ahh
when players join in the middle of a game
they would see all dead players die at the same time when joining a game, since health would be replicated and trigger the death ragdoll
with an RPC.. if they aren't there when a player dies, they wouldn't see it (which makes sense)
right
<@&213101288538374145> Did the "Auto Connect to Server" Checkbox was removed from UE4 settings? Cant find it and no one here has an idea about it. Would like to hear the alternative
yes, ask the moderators who are moderating this non-official community for free, thinking they work for epic
Oh, i thought so. sry 😦
please read the #old-rules before you make another mishap, it could get you banned.
i have read through them but unfortunately i have missed something
thought mainly because the discord is marked as "verified" by discord
@thin stratus Have you find out the new solution which replaces that setting? So your Compendium could be updated here
blu do you have single process mode enabled?
when you enable the option you can see the auto connect option. its invisible for non single process mode.
😮
no 😦
have enabled it but its still not there
i guess it was removed with 4.25
hmm whatever i did now...
Pretty sure it's not "removed"
its not auto connecting
Just handled differently
yea i guessed that
You have this drop down in the play settings
was the "Play Offline" mode there already?
There you can probably set it to Offline or Listen Server
Offline: Every Player is Standalone
ListenServer: One Player is Server, the rest are Clients
Client: All Players are Clients, connected to a DedicatedServer
Pretty straight forward I guess
Are there any naming best practises?
So Offline is without auto connect, Client is with auto connect?
I just wrote what each is
Thx 🙂
I have a game state setup for my main play map (GS_Play). and another for a lobby map (GS_Lobby).
in GS_Play I have a custom Timer I made that the gamemode triggers. but this timer dosnt exist unless executed by the gamemode.
When I load the lobby Level (Has a difference gamemode and game state) It starts the time from the GS_Play
Why does it do this and how can I fix that?
Hm, it shouldn't do that. Can you check the Outliner to see if you really load GS_Play and its GameMode?
My apologies. It was user error. I had two instances of the game open for Multiplayer testing and one loaded the development level where that gamemode was being ran. thus printing it on the other PIE window's screen
When in reality the player in the lobby never really 'saw' the print string
Hi everyone. I have a tricky to resolve issue with my multiplayer game. When clients connect to the server the cammera will briefly spawn at the world origin, which is usually under the map, before suddenly being corrected once the server has created the player controller and set its location. Does anyone know how I can change the default position of the camera before the player even has a controller created for them?
It is particularly bad for clients with a slow connection, they will sometimes spend several seconds staring at the underneath of the map before being moved to the correct place
i'd be interested in this solution too
Oh hell
I just picked multiple clients in there
That can't be possible. I must be missing osmething. How can i have 3 servers connected to each other lol
I remember that 5 years ago, that suff was easier 😦
"play as client" is probably the issue, sounds like you want the default "play as listen server"
Yeah I also tried that now. I think i just need a refreshment. I did a multiplayer game but that was too long ago. And 5 years of Unity clunked my head up.
Thanks anyway for your answer.
What I have for example, if i press E and do a "print string" it prints on all 3 clients.
I forgot about all the checks.
Something like "is owner" or "has authority". I also forgot what the authority part means.
Or is that a new feature? Idk.
I make "print string" and it prints Client 2: hello
I think I asked before, but how do you replicate setrelativelocation? or rather what alternative could I use since it doesnt replicate by default
So maybe that "print" gets "replicated" for debugging stuff to all clients. But I can't rememeber that this was a thing before
The various aspects of multiplayer applied to Blueprints.
I don't believe so
That might be the reason why it attaches "Client [idx]" to it
Hi, I have a hopefully dumb question. I need a Client to check something from the Server, but when I run a 'Run on Server' function, I need it to return back to the Client without running on the Server
I tried ending it with a 'Run on Client' function but that does nothing
I don't believe so
@bitter oriole I think I'm right.
I made sure it executes only on server. And it prints to all clients "Server: [my mesage here]" (Server spawned replicated object, so authority is server)
Hi, I have a hopefully dumb question. I need a Client to check something from the Server, but when I run a 'Run on Server' function, I need it to return back to the Client without running on the Server
If the client is owner you can run "replicate to owner" or so
Idk if unreal has that, if yes, idk if blueprints have that. But you might be able to RPC to a specific client id. If that doesn't work, you could pass an id or something like that to identify clients, and a client only reacts to that RPC if the ID matches
can u replicate anim montages? no matter wut i do, it wont play on client?
@shy kelp I don't think so, I use net multicasts to sync animations on client
For example, if I want a wave emote, I would use a server function to tell the server I want to wave, and then the server would call a net multicast. The net multicast function would then play the montage
got a general 'best practices' question. When making a pickup system (think finding different values of treasure) Is it a good idea to make a parent class and create children of that class for each tier of treasure to spawn around a level?
alright thanks man. My thinking is along the right lines then
i did it in my game and it's helped immensely, I only have one pickup class to edit and all the changes/fixes are propagated to dozens of different items
thanks for your help @warped stream but that doesn't seem to work; anything run on the server refuses to run on clients for some reason. I feel like I'm doing something silly here
How do I check if I own an object, like, is owner thing?
thanks for your help @warped stream but that doesn't seem to work; anything run on the server refuses to run on clients for some reason. I feel like I'm doing something silly here
The server should be able to send an RPC that runs on the client normally
Thanks DucatiSteve, appreciate the input. It's good to know that I'm not heading down the wrong rabbit hole
@normal jacinth Make sure that the object you're calling the function on is set to replicate, ensure that the RPC is set to "reliable" if it's crucial it always triggers
thanks @hybrid zodiac, it's being run on a player character so it's all replicated
and it's all reliable
Ok, I think client functions only run on the owning client as well, so if it's an AI-controlled player character then you as an observer won't get the client command
Or if it's controlled by a different player
If you want something to happen for all observing players (and the controlling player) then you need to use a net multicast
This is the blueprint from PlayerCharacter
the problem is if two people with a bit of lag try to pick up the same item at the same time, it messes up as they both think the item is free to pick up
so i need to check with the server if the item has been picked up first
but that function on the right only runs if you're the server; if you're a client it doesn't run at all. I've tried it as all the options (not replicated, run on client, etc)
How can I check if I own something?
For example:
BeginPlay: Do something only if that is my pawn
Something like "Has Authority" but something like "is able to execute stuff on server on that pawn
are you running from player controller? there's a function to get controlled pawns
what are you trying to do exactly?
I have 3 players. Each player has it's own character and every pawn of every other player exists on every other client.
So, 3 + 3 +3 = 9 characters if you sum all up. (BTW I use the controller)
So BeginPlay: gives me 9 mesages now.
I want to restrict "code" to "is current local player" thing.
So
Begin play -> (Some check) -> Here executes only if it is my pawn. = 3 strings. One per client.
I want to wrap it into a macro to use like "has authority".
The thing is, I want to check if it is my pawn I'm acting on, So I don't fiddle around with other player pawns
is this local multiplayer?
No online
sorry I don't understand why you have 9 character with 3 players
3 on each client
If you and me start a coop game, the total amount of characters is 4 (not 4 in-game, but like they exist in "real life" 4 times)
Which means. If every character, on every machine prints a messsage. You get 2 messages (2 on your machine) and i get 2 (2 on my machine). That means 4 messages.
right. but isn't your player controller assuming control of a pawn?
But I want to only get 2 messages totally.
First message is on your screen from YOUR owning character, and one mine
Like this?
right. but isn't your player controller assuming control of a pawn?
I use the default one. It looks like it doesn't let input actions through. So If I press Space, it only jumps for my character.
However, the begin event stuff (which makes sense) does that
Like this?
I already saw that. But what about the index
If that is always 0 for the own player then it works
player controller is only seen locally, and by the server
OH
so it should be 0
that will tell you a lot about the different classes
it explained to me why so much of what I was doing didn't work
Nice thanks
This is the really useful bit
I forgot so much. Damn. I start to remember stuff
I know that diagram it's pretty old
I know the overall concept and what parts I need. It's just me not knowing how to get what I need using the engine
GameInstance is the useful one it misses out; seen only by the client, and it persists across map travel
i'm trying to make a online kart game, i have never worked with networking before, i'm having a couple of issues, the server player moves just fine but the client player won't move, if i press the acceleration button it won't move but it goes a bit forward and if i jump it jumps a bit and imediatly goes back to the ground
the other issue is that the UI is swapped
server player speed is showing on the client window and the same to the client
NetworkFailure: OutdatedClient unreal
I'm getting this trying to connect (directip) to a server. the app is supposed to work for windows and mac so I have to build in two different machines, which I guess is what's causing this problem, is there a way for me to say to him to ignore this outdated client error?
i have a widget component with a text box in the the widget... ive setup a variable called text that gets set from the umg widget to the widget component actor, and its set as a rep notify, the rep notify function then sets the text back to what it is on the umg widget itself (but theoretically it should do it on all connected clients...)
but it doesnt
hey guys, has anyone come across this weird error ? FindPlayerStart: PATHS NOT DEFINED or NO PLAYERSTART with positive rating ?
I have no idea of where it could come from
@indigo viper did you create any overrides perchance?
i have been trying to network dropping a sword and i am losing my mind from all the bugs, plz tell me there is a better way.https://blueprintue.com/blueprint/bcf1-a55/ both events are run on server
also thank u @hybrid zodiac, your advice from b4 worked for montages
@stoic acorn yep, I select a PlayerStart depending on the color of the local player's team
The error appears randomly by the way
@shy kelp Glad I could help 🙂
Where does ISteamUser reside?
@indigo viper What does your Find Player Start override Graph look like?
With a pickup system, would you put the overlap logic on the character or the pickup?
@plush wave ISteamUser is part of the Steamworks SDK
The same for all the other Steam platform feature interfaces.
Quick question, I'm trying to get GameState on a client and it's returning null. How are you supposed to access data on GameState from a client?
You maybe accessing it to early, the GameState is a replicated actor, which means it wont be created until its state is pulled down from the Servers version of the GameState.
Gotcha
Hm I put in a 5s delay and it's still null. Does delay in the BP main event loop prevent replication?
Can you post your code?
You maybe trying to cast it to something that it isnt.
Therefore it will always be null.
I put a breakpoint on the foreach loop and it gives me null on the output node of the "get game state" block
Are you sure that Cast isnt failing?
Convert it to a unpure cast.
See if it fails.
Just tried that as I saw your previous message, still fails hmm
HAH what a fail on my part
Just noticed my output log
LogGameState: Error: Mixing AGameState with AGameModeBase is not compatible. Change AGameModeBase subclass (LobbyGameMode_C) to derive from AGameMode, or make both derive from Base
So I guess my problem was my game mode was subclassing GameModeBase and my game state was subclassing GameState. I changed my game state to subclass GameStateBase and problem solved.
Yep
Thanks for the inspiration I've been on this problem all morning.
Went to take a screenshot, then thought, wait a second maybe I should post my logs too, and then bam, red text in there.
Another question: Looks like my code wouldn't work without a quick delay because as you said, the replication isn't done at the start. Is there a way to wait for it to be replicated (some kind of On Game State created event or something) or do I need to roll my own timer to constantly check?
Didn't realize I needed Steamworks. Thought the Steam Subsystem would be enough. Thanks!
so i've upgraded to the latest version of unreal engine, 4.25, from 4.22, and now my online subsystem steam is telling me "STEAM: Steam API is Disabled!"
a couple weeks ago i came across a post somewhere that something had changed related to this and broke it and there was a new way to do things or something, can't find it though
How does one use FOnEncryptedAppTicketResponseDelegate? I get a error: '__Internal_AddDynamic': is not a member of 'TBaseDelegate<void,bool,int>
if it's multicast
if it's not you'll just pass FDelegateType::CreateUObject (if callback is on a UObject)
pretty sure with that one you pass an FName to the name of a function
with non-dynamic delegates, the callback function doesn't even need to be UFUNCTION()
Right, but functionally they are the same?
Ah ok
How do I actually get the steam subsystem?
^This can't be right lol
you don't use UObject casts
use static_cast
and in the ::Get() you should really be explicit in putting steam there
and this->?
this-> is fine from what I know
yeah it is but pretty unsightly
I got some questions about hosting servers and I don't know if this is the right place to ask
yes
anyway, does unreal need a good pc to host servers
Thanks!
@radiant heron that's a very broad question, the answer is "depends"
it's more on the game than the engine
What if it is the simple fps template
What if it's the FPS template (just an example)?
the basic one
unreal provides
yeah
what if I'm aiming for 20
what would the pc need? more ram, more cpus..?
or both
this is a very game specific question
i told you the fps template
yes because i've benchmarked the FPS template
you need to run it, if it struggles use the profiler to find out why
it's up to your project to define what your min spec is for client and server
@lost inlet with that cast using FOnlineSubsystemSteam, how would I know if it succeeded or not?
it's a static cast, it's doesn't fail
if the pointer's null then the OSS isn't loaded
Ah, right
or doesn't exist
Gotcha
I getting some trouble with my HitReg...i'm trying to get targets making a trace callable by one anim notify to the server side but, sometimes get target and sometime not...maybe tick rate on server or animation don't run on server
any project or actor setting to fix this???
if anyone can help...I'm grateful since now...
the anom notify run of client side and call a RPC to my server on the actor component
I feel that sometimes the collision doesn't happen as it should
does anyone have an issue with UMG running code for client 1 on client 2?
what am i doing wrong that the code is being ran as another client?
i think you'll have to be more specific on the issue
hmm
my UI widget has a test button on it; when you click on it it should echo "Hello". I start the multiplayer game as 2 clients and press the button on Client 1. It says "Client 1: Hello" in both. Next I click the button in client 2 - it says "Client 1: Hello" in both. Why doesn't it say "Client 2: Hello"?
So you only have a PrintString right after the button event?
@unkempt stump I'm not entirely certain of this, but I've been led to believe that UI should never have any form of rpc coding. UI should be used to interact with actors and make them call server RPCs. It kind of goes along with the same ideology of general UI use. Use UI to call functions inside of actors to make them do things and get information from actors to display.
that's what I am aware too. I'm not understanding why my button click is misfiring as it appears from another client.
i have no net code involved in my clicks
I doubt it's that. I use the same setting, and my widgets don't call prints from other clients.
it didn't affect anything at all?
Just to follow up on what Cedric asked. You literally just have a print node connected to like a button click?
definitely missing some info since i don't even think it's possible to call RPCs from widget code
hmm lemme see if i can show it
WindowKey+Shift+S helps to take much easier screengrabs.
was gonna try and see if screen recording works on this computer with all these processes running
https://www.youtube.com/watch?v=Cb3UqgDuUNE @small solar @hoary lark
same results if i put the print right after the click handle event
maybe i should try a new project and see if i can replicate it
@unkempt stump I think we're having a bit of a disconnect. Do you mean that the GetPlayerControllerID is returning 1 no matter where you run it?
Multiple things to adjust before further testing:
This should be "GetOwningPlayer" or whatever the node is, to properly refer to the owner of this widget.
This should be "GetControlledPawn" and you are missing the "Self" connection on the GetPlayerControllerID" node.
"GetControlledPawn" and I'm not too sure about having the HUD live in your PlayerCharacter. Either way, make sure you are only spawning it once and not multiple times. Where are you creating these widgets?
the widget is created in my hud class
You can access your HUD class from within the PlayerController
No need to get it from your Character
yep
not sure any of these issues will have impact on the fact that it prints "Client 1" regardless of where i clicked the button tho
Hi, hope its the right section, but is there an up to date (4.23+) example/tutorial out there to figure out how to create/implement a dedicated server ? with google i found only outdated things from 2016, on yt the same. The ue4 documentation seems also lacking of this topic.
Not sure. The Wiki should have one I guess.
Despite that, the steps are relatively straight forward:
- Download UE4 Source Version of your Engine Version.
- Follow the installation steps of it.
- Create a YourProjectServer.Target.cs file for your Server build in your Source Folder.
- Build the Server.
Now step 3 is a bit annoying without docs, but even the Outdate 2016 docs should at least have something to get you going.
I can't seem to cast the HUD from the player controller to my own class...
ok thank you @thin stratus , its hard to find the entry point to learn how to do it 🙂 So im a bit lost atm 😉
@unkempt stump "HUD" is an actual UE4 class name. Are you referring to some custom class you made instead?
if anybody else looking for that topic, epic seems to have it in the new wiki https://www.ue4community.wiki/Dedicated_Server_Guide_(Windows) , for Linux it isnt not in.
That's not Epic's wiki though, but yeah
sorry was messed up in the context menu, casted it
hmm looks to be purely a cosmic issue with the string printer
using the Get Player Controller (0) returns the correct player as I am printing out it's player Id from the player state
guess I can carry on with what i was trying to do before
thanks guys!
You should really listen to exi though, there's a way to do things that works 99% of the time and a way that works 100% of the time
The get player controller by index functions are really for local couch multiplayer
For some reason I can't get the StatsInterface from OSS
IOnlineSubsystem* OnlineSubsystem = IOnlineSubsystem::Get(FName("Steam"));
auto stats = OnlineSubsystem->GetStatsInterface();
OnlineSubsystem is valid but stats not
Is it possible to disconnect from a session, and reconnect (i.e. store some information to allow for quick reconnection without "finding sessions"?) - or what's the correct action when you need to disconnect, modify something, and reconnect to same server?
Well you can save the SessionResult in your GameInstance and rejoin it directly.
Someone here succesfully using the StatInterface?
Oh
Any advice where to research how to implement steam stats?
Okay, thanks
Hey, got an issue with clientside prediction. An action (shooting) is called with a Reliable server command, and I'm using CMC for movement. While the predicted shot is spawned at the correct spot, the replicated shot is behind not just in time, but in position. The video shows the predicted shot and the replicated shot:
My only explanation is that the 'shoot' command goes to the server faster than the 'move' command, and comes back faster so that it doesn't correspond to where you were in the past, on the client, when you made the shot... but I've had similar results when trying to send the shoot command through the compressed flags in CMC.
So I fear that since the shot is always 'behind' when you're moving, the predicted shot will always need to be corrected and look weird ;/
Ideas?
The issue is that CMC doesn't send movement updates every frame, it compresses them together and sends in batches, so while your shoot RPC might arrive, the server might not get a CMC update until some time later
This is why usually you would send the origin and direction of the shot in the shoot RPC
Also even if you forced CMC to send an update in the same frame, you don't know which order the server will process them in
So I tried to include the shoot input in the compressed flags so that it's in time with CMC, but I seem to remember having the same problem. In addition, the input seemed to be dropped occasionally when doing it that way.
If I was to do it with a reliable command, which of the movement functions would the best for sending it?
Sending the origin and direction sounds hard to deal with to prevent cheating
None of the movement functions are reliable, they are all unreliable by design
All you do to prevent cheating is check whether the character is reasonably close to the shoot origin / direction
Hmm yeah, that might be the way to go, if all the others are unreliable and cannot guarantee the input to arrive 🤔
Unless I can somehow know at which point it attempts to send an unreliable movement command, and then send a reliable one at the same time? Just to get them 'in time'
Well you can hook into CallServerMove() in character movement, but again that's not called until CMC decides to send a movement update - so it won't be the same time you make the shot.
But you also still can't guarantee what order the server will process those RPC's in, if it processes the shot first, then the character won't be in the right place.
I see. So on one hand I'd have to choose between risking delaying the shot with 0.x seconds (and uncertainty in the processing order), and on the other hand I risk making it look kind of weird for a listen server, as the shot would be ahead of their gun
Basically if you rely on Character Movement at all to determine the shot location and direction, it will rarely end up where the shooter thinks it did
We send shot origin and direction and an ID with every individual shot (and all reliable.. FML)
And that's a 100-player game
I see. Do you have an issue where the shot appears to be ahead of the other clients' movement? That's kind of what I'm fearing will happen if we process the shot command before the move command
Nah we use dedicated servers so it's not an issue there, but if it's any consolation shooter game does the same thing and that supports listen servers.
But on the flipside, it also doesn't do predicted projectiles
Unreal Tournament uses the character movement to infer projectile direction/location - but it only works for their very specific setup
I see. I think I'm gonna try to trust the client within a threshold on this then, and see if it looks acceptable to the other clients. A listen server has such an advantage either way that I'm willing to accept a discrepancy from their view
If i replicate an object ref, and modifie a property of it, for example disabling physics, does this replicate to clients?
Or is replication ownly for setting the variables value
Depends if the object itself replicates, and if the property you're changing also replicates.
Replicating a reference to an object is not the same as replicating the object itself.
I see. Thanks
Keep getting this error when im trying to start AWS with turn on my computer to create a pixel streaming service
Im not sure if its related, but when i start the program (with run commands proper) it doesnt show a streamer connected on the cirrus console when i start the application, and i cant connect to my public IP with has been port forwarded on the correct ports.
Now im able to get into the Ip adress where it says start game, but when im starting the application, i cant get a streamer connected
In logg it does say "[2020.05.19-11.47.59:549][ 0]LogPixelStreamingSS: Connecting to SS ws://1xx.xx.xxx.12:8888"
But does not have any other messages than this
Can you have a player disconnect (by choice) from a playing level and continue on as single player? I tried "Destroy Session" (on the client using the Get Player Controller ID = 0) but it seems not to disconnect..
will client and muticast RPCs work even if actor replication is paused by AActor::IsReplicationPausedForConnection ?
has there been a change since ue 4.21 that might cause "STEAM: Steam API disabled!"?
No
i have the steamworks sdk, i've enabled the plugin, added all the stuff the documentation says to the defaultengine.ini
Are you in editor ?
the only difference is i upgraded. i'm getting it in both running stand alone and launching it. even after packaging it and running it
i know it doesn't work in PIE
which is fine, but the stand alone isn't working either
i saw in the ue 4.25 they made some changes for better online subsystem integration, i'm wondering if that had anything to do with it
i've copied the dll's that are needed, basically everything i did before that worked in 4.21
i had an issue before because steam was running as administrator but ue wasn't, but thats not the case now since i fixed that a while ago
No need to copy anything
when running as standalone, where are the dll's loaded from?
As of 4.25 you need no copying of anything (neither did previous versions)
ah nice, ok, so maybe thats old documentation
The doc is plain wrong for launcher builds of UE4
haha, i've noticed quite a few of the related documentation is definitely out of date and wrong, so took a while the first time to get it running
one guy mentioned to add it as a non steam game to steam, but i'm certain we don't have to do that, i didn't do that before to get this working
i can't be 100% positive, i have been working on other parts of the game for a while now, but i think the only thing that has changed since when it was working until now is that i've upgraded to 4.25 (building source)
There is a bug in standalone https://issues.unrealengine.com/issue/UE-92985
If you're on a source it's a different business
interesting
let me try running the packaged game again, i tried it yesterday but i've been playing around with things now
Basically the source doc is for updating the Steam SDK in source too
And packaged linux dedicated servers don't work for me either. Although Epic noted that they do if you generate steamclient.so on a linux computer, even though that's what I did. Waiting to hear back from them on my bug report about how they generated it. https://issues.unrealengine.com/issue/UE-93277
so maybe i did something wrong yesterday
give me a couple minutes to try running the packaged game, i'll post back, thanks guys
Hi guys, i have a question: does unreal basic movement replication provides simple cheat protection? Is client sending his transform after he made the move, or does he only send a data that server need to simulate the move and then send results to the client?
client sends the movement to the server
server updates the player position and does validation and collision and stuff, then sends position back in intervals
client simulates the position until it gets the real position back from teh server
yup~
i was looking at the source of the online subsystem steam plugin, and it basically creates a new instance of FOnlineSubsystemSteam, then checks "IsEnabled", which is returning false
its a little difficult to figure out exactly where values are getting set and stuff because of all the macros and my lack of knowledge of the codebase, but i'm going to try to dig in a little further and see how that function is deciding its not enabled
ah man, @jolly siren @bitter oriole you guys were right, there's a bug in the standalone. i'm able to use steam api with the packaged game
well i guess i'm assuming its a bug, it doesn't work in standalone
yes, I've linked the bug report
i'm going to look through the code to see if i can figure out whats going on there
i saw that, i was just confirming i guess, haha
shoot, thats kind of unfortunate though, i don't want to package the game every time i need to test the steam api, bummer
There is a workaround for 4.25 not loading the Steam OSS when testing in Standalone.
Remove the -MultiprocessOSS argument from the CommandLine in PlayLevelNewProcess.cpp line 101
CommandLine += FString::Printf(TEXT("GameUserSettingsINI=\"%s\" -MultiprocessSaveConfig "), *GameUserSettingsOverride); /*-MultiprocessOSS*/
@median elbow ^
thats great! thanks @jolly siren ! i've gotta compile it now, but thanks for the work around
no problem 🙂
interesting, so steam is just simply disabled with that command line arg
haha, i'm glad i'm running the source
That is correct
so you need to build the engine from source to make steam overlay work in 4.25?
Currently in-editor, yes
Right-clicking the uproject and clicking Launch works fine though
Until https://issues.unrealengine.com/issue/UE-92985 is fixed
I'm more concerned about https://issues.unrealengine.com/issue/UE-93277 right now though
Hey guys, I have a quick question. Is Epic Online Services a replacement for the Online Subsystem?
I have recently started learning how to do Multiplayer in Cpp with the Subsystem, and I was wondering if I'm basically learning this for nothing now that the Epic Online Services have released?
I doubt it
EOS will be one online susbsytem
But the OSS API should work pretty much the same as Steam's OSS
The actual multiplayer code is unrelated
Great! glad to hear that
So now ive got a streamer connected, but he cant accualty get stream from the running application to the pixel stream, only local users, othervise the cirrus client (AWS with turn) stops working
Hey. For authority things. "has authority" for pawns controlled by players. Who has authority over them? Only the server or server+owner (client who controlls it)?
The server has "authority" over everything. Clients can have "ownership" of things though, e.g. their controller and pawn
Client can definitely have authority
Like. On all players on each client. So 3 clients = 12 messages
On non-replicated objects created locally
Darn technicalities 
OHHHHH
If i use a child blueprint thing. That thing spawns a the given blueprint right?
So server spawns the pawns, which works, and clients evalute the child actor thing, and spawn that child actor client side
Thats why every client has authority over every players child-actor because they spawn it, is that correct?
that must explain it
Is there a way to "include" another component in unreal? But not like a child actor thing, something that has to be spawned?
I want to get all the logic that has to be together into another blueprint. I tried a component, but a component doesn't have a transform and I attach stuff to that component
And I don't want to have to call that component and set a scene parent for attaching objects.
While I write this, I thinkg a scene-component subclass should work.
is there a article on how to set up a dedicated server for multiplayer
there are components with transforms 🙂
Yes I already found out thanks.
Is that thing I wrote about the authority thing true?
I only just recently started learning MP myself, so unfortunately I cant really say yes or no, but I think so
Thanks! much appreciated 🙂
@unkempt dock https://allarsblog.com/tag/dedicated-servers/ I think this still holds true.
ok thx
whats wrong with that. my onrep never get called.
UPROPERTY(EditDefaultsOnly, Replicated=OnRep_FirstHitPack) FDezHitPack FirstHitPack;
Did you add the property to GetLifetimeReplicatedProps()?
And is the property actually different to the clients value when it's received?
By default the OnRep is only called when the property changes from it's current value.
yea I added it to GetLifetimeReplicatedProps like other
owg. no way. wasn't it ReplicatedUsing ?
😂
Any reason why I can't use my macro library "object" in a Scene component?
I can use my anctor one in an actor
And since the Family is
Object -> component -> Scene component
I should be able to, but it doesn't show up
Should be able to use it AFAIK
May need to show some specifics here though
Also is this MP-related?
has anyone used multiplayer LAN over something like Hamachi or Zerotier when testing development builds with friends?
Also is this MP-related?
Fixed it, restarted unreal.
It was a mistake posting it here, but since its a multiplayer project and a replicated class, we can argue a "yes" out of that 😄
how do we implement FPS spectator ? is there any article , sample, .. ?
Any idea why I can map travel with a client in standalone game, but not pie?
LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = FailureReceived, ErrorString = Host closed the connection., Driver = GameNetDriver IpNetDriver_6
LogNet: Warning: Network Failure: GameNetDriver[FailureReceived]: Host closed the connection.
LogNet: NetworkFailure: FailureReceived, Error: 'Host closed the connection.'
LogBlueprintUserMessages: [BP_P14_GameInstance_C_4] Client 0: : Failure Received
LogScript: Warning: Script Msg: DestroySession - Invalid player state
Map travel with a client?
If you are connected to a server you can only travel with the host via ServerTravel command. If a client travels they will open the new map disconnected
@grave ermine
I followed the following link for starting to learn MP. I followed it to a T but am running into a weird issue where all of my clients are also printing server debug messages. I'm not sure how they could all think they have authority?
https://docs.unrealengine.com/en-US/Gameplay/Networking/QuickStart/index.html
Create a simple multiplayer game in C++.
So I was (and still am) looking for ways to implement snapshot interpolation for networked physics simulation
I read quite a bit about replication and RPCs
My problem is, standard variable replication and RPC functions seem to be the only form of networking tools UE4 provides me with
And none of those are fit for sending an entire snapshot of a physics simulation across from the server to the client
I was hoping for the ability to send out an array, or a list, or some other data structure
Can RPCs do this? Can they accept an array as their argument? I haven't yet tried but it seems like a definite no from the reading I've done
And if they can't, what other tools do I have available? Do I serialize an array with JSON and send the string?
Do I write my own custom net code using some lower functionality tools that weren't discussed in the documentation?
I would love for some guidance
Is the GameState the best place to hold all the treasure items and inventory that each player holds?
why not player state?
would do either player state or make an inventory component for each player on their pawn
I need to be able to keep a list of how many of each type of treasure each player has collected, and when they die to spawn pickups for other players to hoover up
when the game is won by either side to show all the scores in a match table
typically if you have something that exists per player that you want to get replicated out, then its a good idea to throw it on the player state
ok thanks. so all inventory items to be stored on the player state then. I'm kind of struggling to understand where best to put things but it's baby steps. I have all my pickup treasure ready to be stored somewhere before destroying the pickup actor on overlap
one more question before I dive back in.. What's the best format to store inventory things?
depends how your inventory works. you could do simple uobjects if you dont need them to be actors?
The treasure will be the match winning items but I'll also have pickup powers and weapons
Some of the player abilities will be in the form of a weapon (visible and physical thing they will hold)
Some will just be an effect when used
probably gonna want those weapons to be actors that get stored on the player
things like powers can probably be UObjcts since they don't really need to have a presence in the world
Would you use an enumerator or some other way to house them?
I need to learn about UObjects
yeah you would probably have a tarray on the invetory
at that point it'd be good to have an inventory component on the player since a lot of these weapons and such will be physically stored on the actual pawn
can a tarray be networked?
yes a tarray can be replicated
does it have some size limit? can I use RPCs to replicate a tarray?
Alright, thanks for the help guys.
I would not recommend using rpcs to replicate a tarray
Unless ur calling that RPC very often, RPCs should be used for one off events such as Vfx or SFX
replicated variables are good for representing STATE
I want to replicate the array about 60 times a second
or 30 times a second
and I want to be able to run my own logic for whenever the tarray arrives at the client etc
does this^ mean it's okay to use an RPC if its 30 times a second?
or is it the other way around? :P
Having a REAL fun time using a MovementComponent and AddMovementInput(Direction, Val);. It is all herky-jerky
ya
do u mean
rubber banding / jittering /hitching / general shittyness that makes you want to internally die?
@unkempt tiger you probably'shouldn't be sending an array via RPC 60 times a second. if you're sending smth 60 times a second, ur probably updating it often cuz its part of the games state. if its part of the games state, it should probably be a replicated variable
its a physical simulation
data is rigid body positions/orientations
one array to include the snapshot of all of them
so its not part of the games state
so what should I use in your opinion?
@unkempt tiger yeah, jittering and general shittiness. I notice their "shooter game" example has the same bad jitter. What is the solution there? Not use the MovementComponent and do it myself?
what it sounds like ur talking about is the "state" of ur physics simulation"positions, orientations, etc" so i would recommend using a replicated variable
yes @north olive, as much as it's troubling, or use the movement component but write better interpolation
@violet isle thanks for the reply, I am indeed talking about the state of my physics simulation
Would using a replicated variable allow me to run my own* client logic whenever I get a new packet?
yes, that kind of function is called an OnRep
it gets called everytime the variable is chagned on the server
and the array size can vary dynamically?
yes, ue4 TArrays can do that
oh my
warning, doing a lot of this manually might come at a cost as you usually wanna minimize how much data ur replicating
yeah
thats another concern of mine!
Here's the thing: I want to send delta packets based on previously ACK'd packets (that is ACK'd by the client)
This means every client may get a different packet
from my understanding, just replicating the array would mean I dont have precise control of what gets sent to who
Said array would include data of each physical actor
What if client A already has physical actor 1 in sync, but client B does not? Then I'd like to send physical actor 1 to client B but not to client A
If I had a complex physics simulation I would want to be broadcasting movement/attack actions to the server, and have the server apply those.
You want to not send a ton of data over the wire
If I replicate the entire array, I'm sending unneeded data
honkycat in my case the server is the one running the simulation and networking snapshots to the client
just sending actions is not feasible, since that assumes the simulation is deterministic, while it is not
I know it took the Neartherrealms team like a year to do rollback/snapshotting, it is nontrivial: https://www.youtube.com/watch?v=7jb0FOcImdg&list=PL2e4mYbwSTbaw1l65rE0Gv6_B9ctOzYyW&index=52&t=0s @unkempt tiger
In this 2018 GDC talk, Netherrealm Games' Michael Stallone describes the drastic engine changes, optimizations, and tools that are involved in rolling back and simulating up to 8 game frames in 16ms in games like Mortal Kombat and Injustice 2.
Register for GDC: https://ubm.i...
I have a question, which seems to follow from your current debate.
I'm working on the replication of a ball in a non-gravity level (the ball comes out of a player-controlled pitcher).
I'm trying a lot of solutions to make the ball be in the same place in the server and the client (it's a listening server and a connected client, in 1v1, so no possibility to play in the past)
The most effective solution seems to me to be a bullet with physics and motion replication activated. But I can't figure out if motion replication natively corrects the ping difference. And if it does, how can I change its parameters? (Extrapolation, ping limit etc)
Thank you in advance, I've been struggling for many months on this subject.
I have already try custom implémentation of projectil movement component with lerp and server calculation of speed and ping to adjust position of ball client side, but i try again physic and movement replication and it looks like more acurate. So i dont know how make a choice between thèse two methods
First, make sure you understand that it's impossible to fully correct for ping issues because of inherent cause-and-effect relativity
Because two players are separated by ping, there is an inherent conflict of information that you must always keep in mind
You have basically two directions to move in to try and alleviate these effects
- Correct position, incorrect trajectories (extrapolation and correction for ping)
- Incorrect position, correct trajectories (the most common direction, where you verify any sort of events and collisions against the past state of the world)
E.g. in source engine, when you shoot a gun, the trace ray of the gun is fired against the state of the world as must have been seen by the player (by the servers estimate) when he fired the gun
Not when the message arrived to server
I'm not 100% sure what your situation is yet. It's possible to create a hybrid approach of the two, but the relativity prohibits violation of cause and effect
Be it in the real physics world or in the more abstract space of networked computers
For competitive games, you probably want 2
Because then it represents movement of players correctly (even if they aren't perfectly matching on the screen - everyones screen is slightly different and everyone sees an image of the world that is lagging behind)
When you fire at the player, you send a timestamp to the server and the server must roll back all player positions to verify your shot - I don't think this is implemented in stock UE4, but I might be wrong
In our game, we use approach 1, we extrapolate data from server to try and push objects together to ensure that all players see them in roughly same positions (but the movement of objects will be different on each monitor, at different rate and with different smoothness)
Just random thoughts for you, sorry if it's not really an answer 😄
i have a quation i want to use 2d render componenet but the 2d render component should be only visible for the player who uses it for example a sniper scope or a camera
how would i make that ?
This answer is wonderful and compiles all the answers I've seen about the topic on the forums. I thank you very much for it. I think I have correctly understood the theory but I don't know how to make the choice for my game.
It's a 1v1 in VR (great similarity with sparc vr) but you don't catch the ball by hand, but with a gun that allows you to throw the ball back (you're in a closed enclosure, there are bounces and powers that can modify the behavior of the ball, add contact surfaces etc).
I think the most optimal solution would be to have a dedicated server and have players play in the past so that they can compare their moves etc. I think that the most optimal solution would be to have a dedicated server and have players play in the past so that they can compare their moves etc. I think that the most optimal solution would be to have a dedicated server and have players play in the past so that they can compare their moves etc.
But right now I'm on an archi listen server, which also plays so I can't give the server that advantage. I would like the client to be able to replicate the position of the ball and its velocity when the server gives it a network tick, and in the meantime the client simulates the trajectory on its own.
I think my movement replication does this but I'm not sure. In use it seems pretty good, because when I tried to implement my own version I realized that I had to manage the lag due to the lag and make the ball lerper every time there is a deviation and it quickly becomes complicated. I'm looking for a solution to make a viable under 70 ms
The first solution you describe will fit well i guess for my game, since i am ok with some prediction and correction when client is too much différents from server. I saw in Project settings of ue4, "physic error correction" par with ping, extrapolation, error tolérance etc. Are thèse settings related to movement replication ?
You have two processes that you must resolve
(assuming server-authority gameplay)
- Server-side behaviors (it's what you already listed)
- Client-side behaviors - what player sees on screen must feel as consistent and as correct as possible
This will involve some fakery, because server cannot get the perfect idea of clients state. There will be some discrepancy between what player sees himself doing and what's actually happening
In source engine, this is resolved by buffering networked data and effectively rendering the game world 1-2 frames behind what's simulated
That lets you definitely accumulate enough data from server to create reasonable trajectories of movement
For guns, source engine renders the gun fire the way client sees it
But the view angles are transmitted precisely onto the server, there is still some residual error, but the serverside calculation has to trust player on where his view is looking
So the server trusts client in view angles, but does not trust client in XYZ positions
Thank you for all those thoughts. I'll read them again tomorrow, but I think I understand the concept. I don't really feel lost reading you.
I'm just wondering what ue4 out of the box is doing with movement replication,... It's information I can't find (I only work in blueprint at the moment) I guess I should study the C++ code of the function to find out more. But I'm surprised to find no reliable documentation about it.
I have two teams, one of the teams I want to be able to pass through certain walls and locked doors. The other team should be blocked by walls in the usual manner. I can't even think how I should go about starting to create a level with that kind of system. Anyone got any good ideas?
the easiest way i think of doing this is having two collision profiles, one for each team.
and then based on the player's teamid, set the collision profile on their character capsule on match start
if u havent checked out the team system yet, i would take a look at IGenericTeamAgentInterface and its implementation in AAIController
Can I send vanilla c++ classes with rpcs?
Don't think so
Okay yeah, makes sense
I have 2 sublevels of my one big map, each with its own Game Mode. When I called Load Stream Level from one of the sublevels to another, for some reason, the BeginPlay on the Game Mode of the other sublevel doesn't execute at all.
I also couldn't put this logic on the level blueprint itself because that doesn't do server logic, so basically the only way I can think of around this is to stuff all of it on an actor on the old sublevel?
You can only ever have one gamemode, and the one that matters is in the persistent level.
aka the "master" level.
If you need some additional server logic attached to a level you'll have to move it outside of a gamemode, and into some actor you can spawn server-side and control from there.
I see thanks
i have packaged my game . which port should i make sure are open when if i want people to connect through my ip?
So the server trusts client in view angles, but does not trust client in XYZ positions
@cloud ledge thats why spinbots Work :D
The trick is to trust them within a tolerance
Hello, i come with a screen to illustrate today :
Does anyone have information about these settings ?
I feel like no one in the entire global internet has ever talked about those settings.
Anyone here using steam stats? 🤔
yas
I'm having problem updating user stats
int oldValue;
SteamGameServerStats()->GetUserStat(userSteamID, std::string(TCHAR_TO_UTF8(*statName)).c_str(), &oldValue);
UE_LOG(LogTemp, Warning, TEXT("Stat old value %d"), oldValue);
int newValue = oldValue + changeAmount;
UE_LOG(LogTemp, Warning, TEXT("Stat new value %d"), newValue);
SteamGameServerStats()->SetUserStat(userSteamID, std::string(TCHAR_TO_UTF8(*statName)).c_str(), newValue);
if (SteamGameServerStats()->StoreUserStats(userSteamID))
{
UE_LOG(LogTemp, Warning, TEXT("New user stat stored"));
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Failed to store user stat"));
}
The log "New user stat stored" is getting called. But the value doesn't update. That code is called on the server and SteamGameServer() return a valid value
And the GetUserStat returns a correct value
Welcome to my world. So what I found is that the steam stats system is extremely unreliable, it will often just "forget" values you told it to write previously. We had this bug for months, and the only solution we found was to keep our own copy of backup values in case 'GetUserStat()' returns a lower one than something we wrote previously.
BTW, stats writing is asynchronous
So doing this on gamethread isn't safe
Epic has an existing system for interfacing with steam stats IIRC, through the leaderboards / achievements interface.
Also, if the stat is an "Official Game Server" stat in the Steam Backend, then the stat will fail to write unless you whitelist the Server IP addresses in the Backend too.
It is not set as official game server, just a GS. I had it first as client and changing the stat value worked perfectly by client but can't get it working with dedicated server
Server stats are just a pain. The worst part is because steam has no "stat delta" functionality you end up in situations where servers are writing over each other.
We always do a refresh before writing anything to make sure that GetUserStat() retrieves the most up-to-date value possible.
Do you know if being able to set the stat on server requires that there is a steam session/steam server setted up and the player is accepted to that session because currently we aren't using steam networking?
The player you are writing the stats for has to be authenticated in the servers steam session yes
Servers aren't allowed to write stats for players unless they are in the session, it will just silently fail.
Yeah. You definitely want to be using the OSS. We extended it to add a 'GetUserStatsInterface()' (before Epic added one anyway in 4.24) and created out own version for Steam, because it was so damn unreliable.
Client stats are usually ok, but server/official server stats are an endless nightmare.
Yeah. Well we are using the steam OSS, but not steam net driver.
Oh in which case I'm not certain then, there is a callback for when stat writing fails IIRC
And we are using 4.24, but the GetUserStatsInterface returns nothing 🤔
Ah
we forked the official steam OSS plugin due to lacking features
one of the first things we did was remove the steam net driver as a default
since it wasn't as easy to remove that previously
hey all, does the server not replicate animation movement for sockets that holds collisions? I have a collision box attached to a socket and I noticed that A) the socket motion may not being replicated on the server B) the collisions happen on the client(s) but not the server when I print out on overlapping
I wonder if the server is playing the animation, but it seems like it is because i get the anim notifies
dedicated server?
it doesn't update skeletons by default
its somewhere i think in physics settings
That's a complicated question. If I'm understanding correctly, you shouldn't really be replicating animation movement in the first place. It's a cosmetic thing. The player inputs a command to move forward, the server moves the actor and then replicates back to the client that the actor is moving and for it to do the same. The client then uses stuff like the actor's velocity to play animations locally.
Zlo do you know where the setting is?
Hi. How do I return ownership back to the server?
@kindred widget I have a collision box attached to a skeleton socket to update it's location via animation of the skeleton. How am I supposed to have that collisions box's position updated on the server if I can't use animations?
Looks like i needed: VisibilityBasedAnimTickOption
thanks @winged badger for pointing me to the direction I needed!
was a major help in understanding some technical details
found this if anyone is interested: https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1509027-get-socket-location-not-working-on-dedicated-server
I am using UE4 4.19.2
Get socket location working fine on stand alone, but not on dedicated server. I tried to print values and server and client have different
don't have one. What I did was create an actor that was replicated and owned by the server. When it spawned enemies based on my options, it would spawn for everyone. I then placed this actor where ever I wanted enemies to spawn and I set up their config as I deemed good
The ShooterGame sample may have something?
think it would be different for spawning player locations (just make some points in the make to use as teleportation spawns)
Does something already exist to guarantee random numbers generated on the client will match for the dedicated server or do I need to implement it myself? Example, adding a small random angle to a weapon firing so client and server results match.
good question @hearty atlas lemme know if you find the answer please 🙂
(you could just replicated it from the server preditively)
That's what I have done before, had a prebuilt table and would keep the cursors in sync with prediction. It only would get out of position if they had a lot of packet loss, and their gameplay already sucks if that occurs.
lol
are multicast events affected by net relevancy, for example if a character is so far away that its no longer relevant will it still receive multicast replicated events from the server?
Not sure if this is entirely on-topic so if not apologies and I can delete. For development testing of dedicated server multiplayer-over-internet, where do you guys host that? Any free or cheap places to do that for <$10/mo or something? Even a few hours a month right now is enough really.
A random VPS might work fine
What is the best way to send client state from an owner to the server? Is there a lighter method than reliable server RPC?
No
Hey guys, is there anyone here who is experienced with Generalized Subobject Replication who can maybe answer a few questions? I am looking for some guidance / tips to see if this will be useful for the kind of system I want to implement
Hi. I'm in the process of deciding between using Unity or UE4. I want to make a multiplayer game, and I know that UE4 has a lot of built-in multiplayer functionality. As far as I understand the default character controller is using client side prediction and is server authoritative, which is great. My question is if there are any other features for lag compensation built in to UE4? Like hit detection using snapshots?
Nope
u gotta sacrifice your body and soul and implement all that yourself 
I'm not sure if you are serious or not. Would implementing it be very game dependant? So much that it can't be put into the engine level?
we are
I would just assume that a lot of FPS games could benefit from the same system, but I guess not.
ue4 is bare bones af
I've done it twice in simpler engines. It's a fairly simple if you have the right data.
it would get expensive with unreal depending on how you are handling hit detection though
which simpler engines antihax?
Expensive as in cost to implement, or cost to execute on server?
Quakeish era and Torque3D
execute on the server, moving all the actors back to the bone each trace.
It's definitely possible in UE4, but the physics engine doesn't support rewinding or simulating without changing the scene, so you have to work around that
Just built a lag compensation system. It's an adventure, but it's definitely very game-specific
Unity has no standardized way to do multiplayer, so I would have to rely on some third party framework, but I guess what I saw as a big advantage for UE4 isn't that big of an advantage. There is still a lot of work to be done.
god
Does ShooterGame do lag compensation?
why didnt ue4 just make snapshot based networking easier
UE4's multiplayer tools / framework are leagues ahead of anything else IMO
I cant remember
It doesn't no
Shooter is quite barebones
Just a simple bounding box check
They do but only for major engine features ( like rep graph )
No, I just read on their GitHub that it is dead
Ah yeah fair enough
They might update it again when Push Model comes out?
Literally a complete FPS shooter
Oh, sorry, I am thinking of Unity's project which is called something similar.
wats that about a complete FPS shooteR? link pls0x
Oh right, no we're talking about Epics sample project 'ShooterGame'
@chrome bay So you are saying they already have rewinding there, for example?
is it an axis aligned box around the player? or a box for every limb?
around player
per-limb isn't really possible
You have to trust client to some extent
OOF valve did it D:
I must have broken it, i was getting per limb.
Server and client animation will never be in sync
😄