#multiplayer
1 messages ยท Page 106 of 1
Yes
Damn 2.2 Gib .pdb file of Debug ๐
so just slap the .pdb for the server.exe on the server and run it ?
I am currently doing some research on multiplayer and kinda in a dilemma on whether i should use EOS or photon unreal sdk ? which is more scalable in future ?
Depends on the game and your budget.
Epic obviously use EOS for Fortnite, so its certainly scaleable.
Im not familiar with Photon but I would expect it costs money and probably a lot of it.
Similar to the likes of Gamelift and Playfab no doubt.
Photon allows 20 CCU at the moment its one of their pricing plans and its free for development
EOS is kind of appealing to move ahead with multiplayer but if i can get more insights on photon it would be helpful
I am trying to learn how to setup mutliplayer network for a VR headset
nope i am thinking of listen server
Then the choice is obvious, choose EOS.
It will cost you nothing.
Getting started with the EOS Online Subsystem plugin for Unreal Engine.
Take a look at the Redpoint Plugin for EOS
EOS is based on blueprints or c++ ? or both ? cause photon only uses c++
AFAIK, mostly based on C++
@blissful kraken EOS is mostly C++ but there are plugins which expose its features to Blueprint.
Yes just saw it on the marketplace
If you are unfamiliar with C++ you are going to find it harder to implement a fully functional multiplayer game.
Especially with Matchmaking etc
You can't avoid C++ especially you are using EOS to link account with other platforms. Mostly C++ code
I am kinda trying to replicate VR chat
The session handling will be the least of your worries if thats what you are trying to do.
https://medium.com/@invicticide/accurately-syncing-unreals-network-clock-87a3f9262594
Trying to read about network clock. I suppose we shouldn't use getserverworldtimeseconds as suggested by a few article about it?
When implementing real-time network multiplayer in a game, one very important tool is a reliable network clock.
Trying to illustrate a bounding box for when an actor was hit in client machine when the data reached the server. How can I use network clock for this? Do I just periodically save the box location with a time stamp on it, then do I just get timestamp closest to the server timestamp for the location?
Sorry if the question confusing, I'm struggling to understand my self
So you want to briefly display the hitbox as it was when the player was hit on the server?
So the only thing that really matters if the location and rotation, the time is pretty much irrelevant?
I want to have a debug box to illustrate extreme lag environment. A green box is the current location of the actor in the server when the data for the hit is received (which will be the current loc) and red box will be the area where the client hit the actor at his world
Trying to get the diff between the two to get tolerance for verifying the hit
You don't technically need to store a hitbox every frame or whatever.
Every time the client shoots and thinks it's hit, store an id and the location (use an even increasing int32 and a map) - when the server acknowledges that hit, send the id and the location/rotation that the server saw it was at.
When you get that, draw both boxes.
Then delete the id from the map
Yeah I think I am way overcomplicating it. And thank you for the explanation. I totally get it
Would you happend to have a case use for time stamp? As I was told that it is necessary for network game
If you only want the location difference, the timestamp is irrelevant.
Maybe you can store teh send time and receive time back from the server and half it to get an estimate of your lag at that particular moment.
there are times you WANT the latent time
and this, with a more frequent update rate, actually served my old studio fine
it actually is a more frequent update rate in newer UE versions
Do you have q case where you use the time?
round timer, rewinding for validating bullet hits
yeah it updates at 10Hz in 5.2
by default
it used to be an update every 5 seconds
That's the part where I'm trying to understand. So if the hit is invalid, server can rewind values on the client but how do I apply time to check validity of bullet hit
it's easy enough to have a ring buffer of positions and you can send a timestamp from the client
also the game state time does have a smoothing algo now (rolling average)
So as far as I understand, the server will have its time and the client will send its time. Do I just compare where the bullet is at based on the time stamp on the server and the client?
the client sends what it thinks the server time is (from the GS)
Ohh
I will keep on experimenting to make sure I get the whole idea. Tyvm both of you
Hey, on a listen server I have a pre-lobby where players can choose their teams. And after that I want to travel to the character selection map with seamless travel.
But when PostSeamlessTravel is called on the server, the server doesn't know about all the players with GetNumPlayers(), I'd only want to start the initialization process when the server knows about all the players after the seamless travel.
Is there any way to know when does the server knows about everyone?
Or is there any way to know with how many players did the server start the seamless travel, so I could just keep checking until it's right?
Hi guys. Im working on slot based inventory that has a replicated tag stack container for its data (array of GameplayTags and int32s). Evertyhing works fine as long as I use the c++ slot class but if I use a BP derived slot class replication break (even if I dont change any settings on the slot) and I get NetDeltaSerialize mismatch read error.
using c++ class:
BP for the deagle:
any ideas?
greetings, I have 2 children produced from the same father, the replication settings are the same in all of them, but when I use RPC in one actor, it works correctly, but when I use it in the other, it does not work correctly, what is the reason?
this code works correctly on one bullet but not on the other.
Hello, does anyone have some good explanation of UNetDriver? I can't find anything focused on google
How do i replecate my blendspace 2D
In scenarios like those the source code is probably the best you'll get if you're looking for something specific.
Make sure that if you're calling the server RPC that whoever calls it is the owner of the actor.
I mean, neither of them has an owner, but one works and one doesn't.
Then check what's the difference between the two and in what exact step it doesn't work any more ๐
It seems to be fine from your screenshot. But for all I know it might not even be this specific part that's the problem.
The reason why I mentioned the owner thingy is because your SV_Sound event seems to be an RPC from client -> server. Which only works if the client is the owner of that actor.
You don't. Animation is driven by reading data from the character. You replicate that data instead.
How
How what?
How do i replacte the data
There are a plethora of tutorials covering how to do replication.
I'd recommend looking for a starter tutorial.
The pinned posts in this channel have some good resources as well.
Alright thanks
Another replecation question this one is not animation but something to do with the true first person thing it switches from first to third person how do i make the first person rotation show on other players screen for instance in first person if you move your mouse your character rotates left or right baced on if you moved ur mouse left or right how it dont show on multi player idk how to replacate that
Hello,
We are having problems hosting and joining LAN games (with open "ip") on IOS on testflight. Development build works fine IOS-IOS, IOS-Android, IOS-PC, everything works when IOS is dev build, but when we make a shipping build and upload it to testflight game just crashes on open level. UE 5.0.3 from source
I was looking for an overview. Like what should I start from to create one, what exactly it does and such stuff. By looking more I've found this https://ikrima.dev/ue4guide/networking/low-level-networking/low-level-networking-overview/
UE4 Networking
I'm trying to implement a server/client beacon, however for some reason the client doesn't connect to the server. I have followed some tutorials to setup the base code and it works fine using third person example, however the same code and configuration doesn't work using Lyra project. In Lyra the client basically doesn't receive any response from the server, even though they are using the same IP and port.
I have no clue why it may the case, so I wanted to basically find out how the beacons actually establish the connection, and see what is not called and why
In general there are not an extreme amount of resources about things like these. They are rather specific and very few projects actually have a need to do much in the first place with something like changing the NetDriver to something custom.
Beacons are a little more commonly used I believe. There's some info about it in #online-subsystems . You might also be able to find more about it on Cedric's website.
Although I don't know in specific what Lyra does with all those things. Didn't look much at it.
How do you search on his website though? There is no page called "something beacon" , I guess it's nested somewhere
That's.. Certainly a good question ๐
Not entirely sure.
In that case maybe just start in the #online-subsystems pins I guess.
I hate that he moved the multiplayer compendium from the pdf to the website. When I started learning the networking I have used the pdf version, and anytime I want to look back at some of the stuff he talked about I can't find anything on his website ๐ฆ
I can give you the PDF if you want. I still have it on my PC exactly for that reason.
Yeah, sure, I'd appreciate it ๐
Thank you ๐
I am not 100% sure if this is truly the latest version of the PDF but most of it should still be in there regardless.
It's fine
He moved to the site because it is far easier to update and keep current.
It still has all of the same information
From his point I understand it and I don't blame him for it whatsoever, he's not getting paid for it by any of us after all. I'm already extremely thankful he did all of this in the first place. I just don't find it nearly as convenient though.
I find it more convenient
The only problem that I have with the website is that I can't find a search bar to quickly get to specific things
The search function is definitely my biggest issue. The other issue however is that I can't easily download it any longer. If my internet goes down or his webserver goes down there's no way to see it any more.
Which is why I have that pdf in the first place ๐
How can I find out what are the net driver definitions applied in the editor? I find the configs a bit weird, I mean there are different .ini files for each platform and some others for EOS, and each one clears and adds different driver definitions, I'm affraid that the beacon net driver is cleared somewhere, making the client/server unable to establish the connection
All I want is to spawn characters when I hit the Sphere, that's it.
But it only works on the server side. The client cannot spawn it.
(There are multiple same Sphere actors on level.)
GameMode is not replicated (only the server has it), hence there is no point in doing any RPC. Clients can't receive them and send them because there is no copy of the game mode actor on their end.
An actor is usually spawned server-side only, and then replicated back to the clients, so make sure that the actor has the IsReplicated check box enabled.
So a way of doing that is the following:
Thank you for your response. I ran this action in GameMode, unfortunately it didn't work.
Then I ran it inside Actor_BP with RPC, still didn't work. (Replicated check box enabled in Actor_BP details panel.)
You can only run a run-on-server RPC in an actor the client owns
pawn, playercontroller, or otherwise manually set to owning
Playerstate maybe?
So you mean, "GameMode is not a directly owned actor, and you cannot run "Run on Server" type RPC functions directly in GameMode. Instead, you should run the RPC functions inside an Actor owned by the player and interact with that actor GameMode if necessary. "
What do you mean by actors owned by the client? Replicated checkbox? Taking these into consideration, I made RunOnServer > Multicast (RPC) in Actor_BP.
The server can spawn it, but the client still cannot spawn.
So you mean for example you can spawn it directly inside my own character? If so, I'm trying.
not working
Hi guys is here someone familiarized with UnrealEngine Replication? Iยดm having hard time to fix some aspect of the multiplayer I'm trying to implement.
The actor must be owned (GetOwner) by the player invoking the rpc
Too vague question, post the specific issue here
Its your order that's the problem.
If you want this happening on the server, you should just use a Has Authority check immediately on your overlap using the authority path - that'll make sure its the server running everything else.
Don't check if the instigating actor is locally controlled as that'll block the execution further on the server.
From there, you should be able to spawn the actor later on down your code. No need for any RPCs.
Is it possible for me to show you my problem in a VC channel, so I can show you all the context of the game?
Not interested personally
This has me confused, what exactly is an RPC?
If I create an event and say run on server, then any snippets of logic executed inside this event are RPCs ('procedures') that the server is running?
If I try and call a function in my game mode (which only exists on server), that's an rpc?
I feel like I have a decent practical knowledge of all this but my theoretical understanding is bad
Remote Procedure Call
RPC would be the client calling a server RPC or the server calling a Client/Multicast RPC
The function that you actually mark as "Server" "Client" or "Multicast"
That's the RPC
But if I have an unowned actor
And in my unowned actor I call a server rpc to spawn a replicated actor
That will run
no it will not
clients cannot call server RPCs on actors they don't own
server RPCs can only be called by clients that own the actor they're trying to call the RPC on.
Trying to call it on an actor the client doesn't own will simply do nothing.
Generally you want to only call from your player character or controller. Both being something they own
For server rpc
Setting owner can only be done by the server?
i run mine from playerstate ^^
but same rule applies. owned by the invoker
so I can trigger an RPC in MY character,
but not in someone else's character
Set owner node only can be done by the server or im wrong?
Only way i'd trust it
if clients could claim ownership on their own.. ๐
that'd be crazy
a client can certainly call set owner but the server is just going to continue rejecting them trying to do anything with that actor. At best the client will desync from the server's state because it mistakenly things it owns something it doesn't.
Yeah i was just woundering if its possible :D. Posses can only be done on server side too right?
Well what about replicated behaviour of stuff in world
Like you have a door that at t=100 will play explosion effect on all clients
in effect that's done on server
the server can call RPCs on everything regardless of owner. Client RPCs will only run on the owning client, multicast RPCs will run for everyone.
Server would keep track of the time, and replicate the explosion when it happens likely through a multicast.
Are there advantage for grabbing relevant player and running on own client for each of the relevant player as opposed to multicast?
nu, multicast already does that for ya
That's not how it works. On Owning Client literally means the client that owns the actor.
Yeah so in my case the unowned actor spawning another actor on server
I was thinking a 'run on server' event
And the actual RPC would be the spawning node
Not the red event node
So the spawn would be invoked on server
But the red event node would be invoked on ???
When a client spawn something it will only exist in their machine
nu, u cant run a server rpc on a non owned actor... although beginplay execs on server, so you could spawn a replicated actor from a non replicated actor in the server execution context
I'm not talking about client spawning
as has now been stated multiple times: a client cannot call a server rpc on something it doesn't own
what you have said will not work
trying to do so will result in nothing happening
the server rpc won't run
at best you'll get a log that a client tried to do something it wasn't allowed to
u can have a non owned actor in the world that spawns a replicated actor in the server, that works (beginplay authority for example)
Well presumably if actor is unowned then an attempted call is made on all clients and on server, and the client calls are all dropped but the server one goes through?
Server owned everything iirc
Marking an event as "Run On Server" is marking the event as allowing an owning client to call the function to then be executed on the server. It is not necessary to mark everything you want to be executing on the server as "Run On Server", rather only things that you want to allow a client to be able to call so that the server then runs it. It's like allowing the client to say to the server "Please do this".
Events can happen on both the server and client and depending on how those events are called it could be executing on either or both.
For example: Begin Play - it fires on clients and the server for a replicated actor spawned by the server. If you use a "Has Authority" and use the "Authority" path, everything that happens from that point is running on the server. So if you set up a timer from there, that timer will only be firing on the server. So then if you wanted the server to spawn an actor every 5 seconds, you could use that timer to then call a Spawn Actor node to continually spawn an actor every 5 seconds without marking anything "Run On Server".
It should really be called "Send to server" not "run on server"
Too many people think it means "this only runs on the server"
Or "this needs to run on the server"
I understood your second paragraph but not the first
Cleaned it up a bit
I tap into GameState::HandleMatchHasStarted() to do some calculations on replicated variables, but I noticed that not all variables are replicated by this point... (E.g., I have a variable that is replicated with the condition: InitialOnly and it's value is 0 every time (it's default value), but it should be different value by the time the player joins (testing via adding players after starting the server).
When I put in a delay of 0, the replicated variable is then seen to be the proper value the next frame. Is this a safe thing to do? Or do I need to use a different method (e.g., don't use HandleMatchHasStarted) to ensure I'm always grabbing the latest replicated variable?
I am sure I have some cases where I'm unnecessarily run code on both clients and server and this is causing bandwidth issues
Slight correction... A delay of 0 does not fix it. If I extend the delay it does, but obviously relying on delays in a multiplayer game is a bad idea, so what is a better solution? I'm bummed because I thought HandleMatchHasStarted() was safe
also once you're server side, you stay server side, unless you explicitly move back to client(s)
Hey. You guys ever seen this? I have two reliable multicast functions that I call on the server's player character in c++. One of them is called on clients and the other isn't. The one that isn't called on clients is still called on the server itself...
does possessing a pawn with a player controller automatically assign a player ownership over that pawn
yeah cause the controller owns the pawn when possessing it
I have a vehicle blueprint, and Im setting up seats for the vehicle, but the problem is the clients have to RPC on the vehicle and they can't all own the vehicle.
How can I get past this?
don't rpc on the vehicle
In Pawn:
Input -> ??? -> TryEnterVehicle(Run on Server Event)
TryEnterVehicle -> do the vehicle entering stuff
The rpc has to be in your pawn or playercontroller
once the logic is serverside (after the RPC) you can do whatever,
is there a way to go from the vehicle blueprint to the controller to the server
the vehicle and pawn etc exist on both the server and client
your question doesn't make sense.
a run on server event can be triggered on the client side and it'll run on the server side
My Enter Vehicle function and variables are on the vehicle blueprint itself
that's fine
read what I posted
RPC inside the character
THEN do the vehicle entering stuff (you're on the server now)
ill try this now
So would I cast to the character from the vehicle bp to call the function?
and then do the rpc on the character?
Here's what you're currently doing:
Pawn Vehicle
Input -> Talk to Vehicle -> RPC -> Enter
And here's what you should be doing:
Pawn Vehicle
Input -> RPC -> Talk to vehicle -> Enter
Only reason this is a bit more confusing is because the Pawn can only Try to enter the vehicle, its only in the vehicle bp where it decides weather you can actually enter the car by checking the seats
Seats can be a replicated property, you can handle that case before the RPC
Start like this. Make a function on the vehicle that puts a pawn inside it (whatever that means in your context)
i see what u mean, ill do the check on the pawn input and then once I know I can enter the car, do the RPC
great, i should just have this all in the character at this point
for some reason i didn't realize i could modify the vehicle variable from the character
The character should handle everything up to getting into the actual vehicle. The vehicle should handle putting the character into a seat or whatever I think.
It can go either way though
Welcome to #multiplayer , shit's hard.
The code I've presented has to be run only server-side. Generally speaking client never call any SpawnActor. Make sure the actor that you're spawning is replicating (i.e. Is Replicated checkbox is enabled)
I would start out by making a vehicle with an overlap sphere that yeets any character that walks into it into the vehicle to test that part without relying on the client doing anything but walking near it
once that works, implement triggering it from the client
make sure small parts work before tying them together
and if you want to Press E to enter but also Press E to do other stuff, look into an interaction system
i mean im not gonna have a lot of stuff for one input, maybe max 2 or 3 things
So would branches just be fine for that?
I mean like E to enter vehicle and then E to pickup item, and E to open door
thats 3 things
Ill watch some youtubes ab interaction stuff when it comes to that ig
It just turns the character-side code into something like this:
Press E -> determine what to try to interact with -> RPC
RPC -> Interact with it
That's it for the character really
then what happens depends on the reciever of the interact call
A vehicle puts you in it. A door opens. An item has you pick it up, etc etc
this is nasty
When is it safe to assume a replicated variable will be given to a new player? I thought HandleMatchHasStarted() would be the best spot, but this seems to give inconsistent results (e.g., so actors will have their replicated variables correct and some will be incorrect - e.g., still their default values)
never, the engine makes no guarantees about when replication occurs aside from some very specific circumstances
Well... shucks. Maybe I'll do some RPC stuff instead
Ive noticed (maybe by luck?) that when I spawn an actor at runtime the HandleMatchHasStarted function always triggers after I have replicated variable values, but actors placed in the level don't. Is this just me getting consistently lucky? Or is it behaving differently because the actor is spawned at run time
What are you actually trying to do?
A lot ๐
I have a delegate setup that any actor can tap into that fires whenever the HandleMatchHasStarted function fires (if it has already been fired before I tap into it, then it'll just call the passed in delegate right away). A found this to be a very handy 'Networked_BeginPlay' thing, but now I'm calling into question whether or not the assumptions I made about this method are valid
In one actor, I can get the latest rep_notify variable to set things up so late joiners will have a valid state when they arrive. This class is spawned at runtime and never has a problem.
In another actor (not spawned at runtime), I'm trying to sync a variable that'll get updated locally in a timeline node (replciate with initalOnly). But the variable doesn't have it's latest value, so now I'm worried my whole system is based on a false assumption and I've just gotten consistently lucky with the first actor
Hey folks, is there any way to prevent the player from kicked back to the entry level every time a network error happens? I found this thread- https://forums.unrealengine.com/t/network-error-force-loads-entry-map-for-client-when-server-shuts-down/405257
Is the only way to do this to change the default entry map? Maybe I misunderstood the thread. Myself and my clients are quite perturbed about being booted back to the main menu screen instead of a character selection screen, and unfortunately clients cannot be logged in upon starting the game at this time
This seems to have been an issue for some time now without being resolved. If a listen server disconnects, the connected client in the session will get a Network Error event and is then loaded into Entry, regardless if that Network Error event is connected to a Open Level or console command (open mapname) these will be ignored and the client wi...
Okay now im having a problem where clients can't access the box collision that is in the seat item, but the server can.
Accessed None trying to read property BoxCollisionComponent_14_4FB63B7A4AD9D572F8A83AB49529E3C1". Node: Branch Graph: GetClosestSeat Function: Get Closest Seat Blueprint: BP_ThirdPersonCharacter
I can see at runtime that its set
what doesn't make sense is that it can access every other variable in the seat array
just not the box collision
how is the client able to access the boolean but not the component that i know is set
it knows that seat 0 is unavailable but the box component prints as None only on clients
No, you cannot prevent a disconnect. This is a low level operation that ensures the engine remains in a stable state.
Thanks for the reply! I'm not worried about the disconnect, I'm curious if there is any way to change the map that clients get booted to? Apologies, my original post wasn't worded quite like I was intending
That doesn't involve changing the game's default entry map, anyway!
Is there a way to change the default NetCullDistanceSquared value without modifying the UE source?
For all AActors at once? No.
yeah, ok
After taking a look at the code path this uses.
It seems
As though you can change the UOnlineSession::HandleDisconnect function to inject your own method for disconnecting.
As its virtual
And is whats called to ultimately force a Client Disconnect
Via GEngine->HandleDisconnect(World, NetDriver);
๐ I'll take a look. You are a lifesaver, thanks so much for your time.
You may want to setup your own function for this
As UEngine::HandleDisconnect is not virtual
And is what sends you back to the default level
You may want to duplicate this function and just change the specific code for that
To your level you want
Actually, looking at our code, it seems we have literally done the same.
UPGGameEngine::HandleDisconnectToHangar
Fan-friggin-tastic, this is great news
It seems that by spawning the actor at runtime instead of placing in the world, HandleMatchHasStarted() will trigger AFTER replicated variables have been received, whereas if the actor is placed in the world, it will maybe be correct inside HandleMatchHasStarted(). Granted, this is just through testing multiple times... So, it could still be wrong, but I geuss for now I'll assume it's safe if spawned at runtime
Essentially, the root issue is when a player joins a match, an actor's begin play (or HandleMatchHasStarted) will fire BEFORE any of it's data has been replicated with it. I guess I just expected it to spawn with the most recent replication data
Most recent being anything that was fired before the player attempted to connect (I realize if stuff fired while connecting/shortly after connecting but before everything was initialized, that that replication data might not make it in time)
@left lance if the Actor that is placed in the level has NetLoadOnClient or whatever it is called set to true, then you might have BeginPlay with the default data? Try setting it to false and the Actor should spawn from replication
hi guys. i'm trying to test multiplayer in my game using "standalone game" and "use one process" unchecked. When both processes are running, putting the windows side by side it's easy to tell how how the unfocused client is chugging at 5fps + major network latency.
When i test lyra standalone side by side, the gameplay is relatively smooth on the client that isn't even in focus. Is there an easy explanation as to why this is possible and how i can achieve the same to test my game appropriately? thanks!
Setting it to false did fix that issue, but then it cause some other issues (Actor passed in via spawn variable, but replicated) was null in BeginPlay of that actor. So, not quite the solution I'm looking, but it's a good one to keep in mind for the future. Thanks!
@left lance multiple actors replicating at the same time is kinda never guaranteed to be valid on BeginPlay. That's what OnReps are for
Do you have vsync or another FPS cap enabled? If not, the focused game will take all of your resources and there won't be enough left for the unfocused client to render fast enough
Ya, that's what I'm quickly learning
I do not understand the replication very well, I want to execute a Server function on an Actor when I interact with the Actor doing an Input Event. Some help, please?
Read the Ownership part of the Compendium
You can't execute ServerRPCs on Actors that the calling Client doesn't own
Your Interaction stuff has to happen AFTER the RPC, not before it. You have to RPC in the Character or wherever first.
Okay, thanks
If a replicated array is updated multiple times in one function on the server, will it batch replicate to clients?
I would expect batch
so only one exec from OnRep_MyArray
If it's updated synchronously then yes
A frame of replication won't come mid execution
And there's no silly queue for whatever reason
good, thanks
so the error is in my code ๐
Depending on what's in the array, e.g. if it's pointers to objects, you might get multiple calls to OnRep, even in the same frame
Structs
Do they contain object refs?
No, just a bunch of tags really
all good then, should only get one OnRep call each time
It's because actors replicate independently, so GUID's might be mapped at different times
I see. Makes sense
The first change will be the array size changing, the second might be one of those pointers being populated etc.
otherwise it would have to wait for everything to be done, before updating the array
Thanks it worked.
Thank you so much.
Guys, there's something I'm wondering about. When I spawn the actor with the RunOnServer > Multicast method, both server and client can see the spawn process.
Only when I do RunOnServer > Spawn, both server and client can see the spawn process.
Adding SwitchHasAuthority also works fine.
If they all work properly, which one is the correct one?
Run on Server-> Spawn
If you're spawning a replicated actor then it should be on the server
The multicast method will spawn not one but two actors on the client, the "real" one the server replicated, and the extra one the client spawned.
You never change anything persistent with a multicast
They are for one shot events only.
Oh thanks so we don't need to multicast since the actor is Replicated
So what is SwitchHasAuthority? I read but I don't understand much. Does that mean the action is run only by the Server?
The client cannot run the server anyway. Why are we using this?
@opaque swift mostly for events that are in fact running on everyone and you can't do anything about it
Such as BeginPlay
So there isn't much difference between "RunOnServer > Spawn" and "RunOnServer > SwitchHasAuthority > Spawn".
Theoretically not. Client could call it locally via cheats but not sure that gives them much
Okay, now everything is forming very well in my head!
Thank you so much.
Guys, what exactly does the "Replicates" tick in Actor details cover?
I mean, just RunOnServer was enough for spawning, but I needed RunOnServer > Multicast to hide the actor.
Is "replicate" just the process of extinction and existence, and "replicate movement" is just for location?
I have this "CustomEvent" on PlayerController and I cast to an Actor, the current "CustomEvent" is Executed correctly in Clients as a Server, but "Change" function not. How can be done it?
Can I call ServerTravel with ?listen parameter while using seamless travel to create a listen server?
you are talking about
if (NoOfPlayers == 2) {
UWorld* World = GetWorld();
if (World) {
bUseSeamlessTravel = true;
World->ServerTravel("/Game/Maps/M_ArenaMap?listen");
}
}
??this
yes. For me, when I pass along the ?listen option after the map name, while using ServerTravel, net mode stays standalone. If I use OpenLevel it works normally
also, I only use relative path for the map name: GetWorld()->ServerTravel(TEXT("MAPNAME?Listen"), false, false); Could it be the problem?
The purpose of that function should be changing the map while carrying all the clients with itself, compared to OpenLevel which would only change the map and don't care about any network connection (whether as server or client). I'm not exactly sure on this but ServerTravel might be required to be called from a server only due to it's purpose. So if you're on standalone, you might first need to use OpenLevel with ?listen to become a server, which then might allow you to use ServerTravel
I can try using OpenLevel, but am I still gonna be able to persist data? I mean is it gonna be considered seamless travel?
So, we have a compendium that explains this
So I'm not going to repeat what's already written in that
Please check the pinned posts and read through that
If you still have problems after reading it a bunch of times, feel free to ask again
I want to say OpenLevel would be a hard travel so you shouldn't be able to carry data or have seamless transition but I'm again not so sure about this so it might be better for others to confirm/answer this
I'll check. Thanks.
Oh thank you so much
I'm trying to make multiplayer spectating, and I have it set up so that when the player presses m1 or m2 they go to the next/previous player. I am trying to access the player list in the gamemode. I know gamemode is server only, so how can the clients get the player list from the gamemode to switch spectate players as well?
The game state has an array with all player states.
Okay I'll try going through gamestate instead
img 1: gamestate modifying living player list
img 2: player character adding / removing from list when they spawn or die
img 3: player character getting gamestate (at begin play after a few other things)
I get the error "Accessed None trying to read property GameState" Whenever I call either part of image 2
I can't use the default player state because I only want players who are alive
If you're trying to use the player controller then that's not an option. Player controllers only get replicated towards the owner which means that the server has all of them but clients only have their own player controller. You will want to either have some kind of state on your pawn/character or on your player state to indicate who is alive / a valid spectator target.
The photo was shared by erebel55 - Ethan, before. it's beneficial
Thanks guys! Iโll do some more research for a better implementation then ๐
The streamed levels stuff is something I need to dig into more of
Who needs performance anyway /s
I'm not even sure if WP counts on the same streaming levels from before, or if it uses something else
Been a while since I last read on the topic
I've never touched them so you're still many steps ahead of me in this regard XD
Let's say someone deleted the game we published via Steam, after playing it.
When he decide to download the game again, does it download with the save files or from scratch?
Is there a way to host the save files in steam?
Yes there is a way to save the files to Steam's cloud. Consult their documentation
In youe case, because you are using an overlap, you should be using Has Authority to ensure you are running on the server. If you use a Run On Server event, then the client must own the actor you are trying to call that Run on Server event on, and that also means you're letting a client dictate when something should happen which may not be what you want.
I wanted to test multiplayer in Unreal Engine, but I can see the server on my own computer. When I open two different instances of the game on my own computer in separate windows, there is no problem. However, on a remote computer, I can't see the server.
#multiplayer message for a bit of context.
I'm using a duplicate of UEngine::HandleDisconnect, except I changed this line to use a different map to boot clients to when a network error occurs:
I'm using the modified function in UOnlineSession::HandleDisconnect as GEngine->HandleDisconnectToCharSelect(World, NetDriver);, but I still get booted back to the game's default entry map instead of /Game/Rotr/CharacterSelect/CharacterSelectMap
What am I doing wrong here?
Oh shoot sorry should this go in #cpp?
How do i make my ragdoll work in multiplayer
is there a function for a client to detect if it is connected to a listen server vs a dedicated server?
in bp u have these idk if thats what ur looking for
I'm looking at fast TArray replication but I don't understand how it works -- it seems to work on deltas, but what if I send a delta over UDP to a client and it gets lost? how does the array know which version the client is on (so it doesn't need to send an old delta?)
You don't send data over UDP, the engine does. And the engine makes its own guarantees about reliability with its own networking protocol on top of UDP - replicated properties are reliable and will eventually be received (assuming the client doesn't just disconnect)
If the client drops packets then the server will eventually resend that same data. Deltas are based on the client's last confirmed state so if a client never confirms they received something it'll get resent.
I see. so somewhere in the engine is some ACK'ing logic for these fast TArrays?
not for fast arrays specifically
for property replication in general (and delta serialization)
Why is this suddenly not working
it has been working up until now, now it wont even work at all
You would need to explain what "not work" results in and what's the difference between the maps it works on and the ones it doesn't work on
How do I replicate my regolls
What are "regolls"
can any body help me about random character selection
Those have to be executed on the server to return true, I want something you could executed on the client that shows if the host it is connected to is a dedicated server
ragdolls i bet
the way skeletal meshes replicate in unreal is by replicating the root of the skeletal mesh
if you wish to replicate each bone sparately then you'll likely want to send bone data transform from server to client and apply the impertinent interpolations
i recommend you looking at PhysicsReplication.cpp
Rigamaroles ๐
doesnt UE5.3 replicate physics bodies now?
new to mutiplayer
i have a question
if there is 1 server and 3 clients and everyone has same variable named ChosenNumber but with diffferent value
now if i want to take average of all the value , what should i do ??
Get the variable from each player, add them together, divide it by the number of players.
but how , like i know i should do it in gamestate but how i get all player pawn refrence ???
There's a Player Array in gamestate that gives you a reference to all the playerstates in the game. Playerstates have a variable called "Pawn Private" which will be the reference to their pawn.
Loop through Player Array, get Pawn Private from the array element, cast to your custom pawn class that contains the value. Add the values up in the loop.
On the loop completed, divide the total value by the length of the Player Array.
Keep in mind, that value can only be calculated reliably on the server, unless you have your pawns set to always relevant as clients may not have the pawns of all players if they're not network relevant.
can you please tell where did you learn ??like i dont get any good basic c++ multiplayer tutorial
I learned mostly from helping people on here. I'd see someone having a problem, I'd look into how to solve it by mucking about with the engine.
any suggestion for new people in multiplayer ??
question about the blueprint version(and also cpp tbh i suppose) of on replication functions
do they fire even if the value of the variable is default
Onrep calls when the value is changed on server side regardless of default value
why this should not work?
void ASurvivalCharacter::ServerProcessMeleeHit_Implementation(const FHitResult& MeleeHit)
{
MulticastPlayMeleeFX();
UGameplayStatics::ApplyPointDamage(MeleeHit.GetActor(), MeleeAttackDamage, (MeleeHit.TraceStart - MeleeHit.TraceEnd).GetSafeNormal(), MeleeHit, GetController(), this, UMeleeDamage::StaticClass());
LastMeleeAttackTime = GetWorld()->GetTimeSeconds();
}
bool ASurvivalCharacter::ServerProcessMeleeHit_Validate(const FHitResult& MeleeHit)
{
if (GetWorld()->TimeSince(LastMeleeAttackTime) > MeleeAttackMontage->GetPlayLength() && (GetActorLocation() - MeleeHit.ImpactPoint).Size() <= MeleeAttackDistance)
{
return true;
}
return false;
}
it will compile, but will always return false.
I can do like this.
void ASurvivalCharacter::ServerProcessMeleeHit_Implementation(const FHitResult& MeleeHit)
{
if (GetWorld()->TimeSince(LastMeleeAttackTime) > MeleeAttackMontage->GetPlayLength() && (GetActorLocation() - MeleeHit.ImpactPoint).Size() <= MeleeAttackDistance)
{
MulticastPlayMeleeFX();
UGameplayStatics::ApplyPointDamage(MeleeHit.GetActor(), MeleeAttackDamage, (MeleeHit.TraceStart - MeleeHit.TraceEnd).GetSafeNormal(), MeleeHit, GetController(), this, UMeleeDamage::StaticClass());
LastMeleeAttackTime = GetWorld()->GetTimeSeconds();
}
}
and it works, but the quesiton is why ServerProcessMeleeHit_Validate return false
first, don't use validate for this purpose. If a client is slightly out of sync you're going to disconnect them for no reason.
second, debug and find out.
yes, this is what happening
validate is only useful for detecting outright impossible situations such that you want to disconnect a client because they're clearly either cheating or in a state that's impossible to reconcile with the server.
I am disconnected
validate is almost never useful, least of all for checking basic montage timings and distance which are both things that can easily be out of sync in normal gameplay.
I got it, so the problem is I have a range limit to detect the impact point and it will fail yes becuase in my all test I was shooting melee when no player near to me
will not use validate for this case
thank you for explaining this
if I have N clients, does the server keep N copies of bookkeeping information for replication?
I ask because for the fast array serialization, it seems like there's some state that's per-client (the last ACK'd version of the array) and it got me wondering about where that's stored
Is that StaticMesh part of the Pawn?
In theory the easiest is still to make sure the Pawn is the ViewTarget
If not, then you need to manually handle that via some other replicating propery that can identify the owner
Could hide it by default and only show it to the OnRep_Controller receiver
cause that's usually the local player
Sorry for a really basic question, does the Run On Server replicates option for custom events run the event on the client and also the server, or does the client just tell the server to run it and then the client does nothing? Or is it something different?
I have a section of blueprints that I thought would work with Run on Server, but it does not so I think I just have a fundamental misunderstanding
Correct, it is Run on Server (Only) if you want to think of it like that
NetMulticast is different though, it will run on the Server as well as all Clients.
If the event has variables, does it use the server's variables or the clients?
For example I have a variable for referencing the gamemode (obviously client can't get gamemode), so if the event uses Run On Server, will it have the variable from the server, or the undefined variable from the client?
The parameters of the RPC are sent along.
If you have a GameMode parameter on a Run on Server RPC, it will always be empty, because how would the Client be able to fill that parameter as you pointed out.
I'll send my specific example real quick maybe it will help me understand for this specific case a bit better. Thank you for explaining everything so thoroughly btw I appreciate it ๐
So in image 1 I am inside of the player character, getting the gamemode and setting the variable through a blueprint interface I made. This happens during begin play. On the client obviously this value would never be set. For the server though, it does get set and the next calls go fine
On image 2 I am running the RPC Cast To Server event and using the gamemode reference. It is not used as an input of the event, rather just getting the variable set previously. So I would have thought it would use the variable that the server had set instead. But it seems it's using the clients variable (empty)
physics replication has been a thing forever
5.3 apparently added some prediction stuff
i remember the cube were ending up in a different place when falling when i was working on a multiplayer project
tho it was a cube that was not owned by anyone so that might be the reason why it wasnt being replicated?
You might not have had physics replication turned on for that cube, who knows
no i remember ticking the "replicates" checkbox. i honestly think it was the fact that the cube was not owned by anyone so UE was confused which instance of the cube it should replicate
I'd just make a physics cube actor, and begin play -> has authority? -> delay -> big impulse.
see if the clientside version gets yeeted along to follow the serverside one
theres a lot of tuning parameters for physics replication too, you can make it stricter or more lenient
I don't have a video handy but I got player-constructed vehicles replicating really nicely. Havn't caught up in my UE5 version but it should work. Replicating rigid body physics is pretty easy, making it seem smooth and dealing with latency on the client is the hard part.
yeah i pretty much did that when i was working on the game. the server yeets and the clients replicate. it was always just that the cube sometimes ends up in different spots when landing
that's on your tuning parameters
it'll always be slightly different
yep that could be it
you can tune how different you consider to be close enough
10cm is nothing for a spaceship's position, but is a lot for something smaller-scale
yeah that was for a grenade toss thing
so being as accurate as possible was crucial
afaik the physics is simulating on both sides, just the clientside is being "nudged" towards the serverside result, with a hard snap if error gets too big.
i ended up implementing my own physics replication for grenades specifically
yeah i think that's the case too.
at least i know for sure that's the case for how CMC corrects it's sim desyncs
and with the new large coordinate system the error should get less and less
so you can be less strict with the physics correction so you dont overfill the network stack
Did you call mark array dirty thing after removing? (array, not item)
You said add works. I'm talking about removal
So you don't "remove" an item but just change its value?
Tbf they wrote that in the original question hehe
I just woke up to my defense . . .
did you add each item one by one and marked them all dirty to have proper replication keys?
I'm not sure if that's enough. IIRC you had to mark each item individually. I think I had a similar issue at some point.
Ok, sad
I mean, you could step into the replicate function with a debugger and check why it's ignoring the entry
Your array has to implement call static bool FastArrayDeltaSerialize(TArray<Type>& Items, FNetDeltaSerializeInfo& Parms, SerializerType& ArraySerializer); in bool NetDeltaSerialize(FNetDeltaSerializeInfo & DeltaParms)
DefaultEngine.ini
[Core.Log]
LogNetFastTArray=Log
I guess.
as said, for me it seems the items are not initialized properly
I'll see if I can find smth in my old project verions (We removed multiplayer as it was too much effort^^)
we wanted to do an MMO type game, but with 3 ppl, in our spare time. this was not managable^^
Well lack of xp and ppl^^ In the end I was / and am writing all code on my own and if you add MP, so proper prediction etc into the equation, everything just blows up. Especially if there is no one else in your team that has net exp to discuss things with.
Now with Singleplayer things are way simpler and mor managable if I have to write all the code^^
So I think you need to call MarkItemDirty for each item, otherwise it doesn't seem to work, as this is the only place the sets a replication ID.
and maybe prior beginplay, as I think the first bunch could be sent before
(assuming you add the values before, basically add and mark should be in the same function call)
im trying to run listen server in PIE and im getting some errors because i think my 'Get Controlled Pawn' function keeps referring to player one, the host, but how do i make sure the function retrieves the connected clients pawn instead
basically trying to attach a widget component locally to every player
this seems to have circumvented my issue since it seems like otherwise the code runs on the 'server' thus it runs double for the host even if its not meant to
BeginPlay calls on every instance
So if you don't lock it to local controller with that node it will run for every player on the server
the way i had it set up worked just fine when running dedicated simulation but i had a 'is dedicated server' check somewhere down the line
but controllers do exist on both server and local client dont they so theres that
ive eliminated all the errors ive had except this one, im guessing im referencing my player controller somewhere but it doesnt tell me exactly where though 
C_1 refers to connected player im assuming, not the host
hi, can the client change the value of the replicated variable?
should i change these variables server side only
pretty sure client can change the variable on client side but not on server side if youre not using a PRC to run the code on the server but then if the value is changed on the server it will override the value on the client again if that makes sense
so I have to change the variables on the server every time, otherwise this replication on the variable is unnecessary ๐
well yeah unless you need the variable to be different on each client
what if i run Multicast Event and then run Server event?
can i do that?
Server >>> Multicast >>> Server
this is okey?
wait why would you do that though multicast also runs on server
unless you run multicast locally then it runs locally too
I run Multicast to run character animations for everyone, and then I want to do the logic only on the server, using MontageNotify
Play Montage (On Notify Begin)
I want spawn Projectile etc
and this should spawn only on server
anim notifies can be set to run on server and after that i think what you need to do is add a branch with 'is server' to ensure that certain logic only runs on the server
doesnt really matter for coop, i think, but then you gotta have a branch with 'is server' set up in your anim notify logic
mmmmmm
i think it would be better to run 'can run cosmetic events 'false or just literally use the is server branch and what notify are you working with anyway
i don't understand
well this is better
idk i think authority was... hmm
you will have problems with AI because i dont think ai has network authority but i might be wrong maybe someone smarter can elaborate
in case you want ai and players to use the same functionality
in some cases
i should use Get Game State >> Get Server World Time Seconds, for check game time?
can I set server name without advenced session plugin
nope
but if you use dedicated server then I think you can do something with this
with database
hey, I created a 1st person template project to then set it to multiplater later on. The issue I have right now is that the mesh of other players is invisible right now, probably due to the fact that it was a 1st person template. Are there any settings I need to change for my mesh to be visible?
I have two meshes for one character btw, one for 1st person view the other for 3rd person
You guys know much about replicating custom blueprint-based actions?
Iโm not currently worried about client cheating or things like that right now. I just need to know the order in which actions are run throughโฆ like.
If my client needs to move forward with add force. Do I run the add force within the blueprint and the server, then compare them? Or make it so the add force is only run through the server with a has authority?
If we're talking about something like a prop with physics enabled, lets say a barrel for example that can be kicked around, then you would probably want to apply the force only on the server and have Unreal take care of the 'making sure it gets replicated to clients part' as Unreal already covers this in specific. If you're looking for something character controlled I would go for the built in character system, it's fully multiplayer compatible though extremely limited in extending with custom behaviour in blueprints. If those aren't a proper fit for your specific project's needs then you're quite quickly thrown in the deep by making sure it all works on your own. However depending on if it's a blueprint only project I would absolutely stick as much to the engine as you can in this case as C++ is pretty much the standard in Unreal regarding multiplayer, especially for more fundamental things like those.
Sure, it just won't replicate
I have an intermittent frame drop when running my game in editor. Every few seconds at regular intervals. Only happens when playing with multiple players. Goes away in standalone. Any ideas? even if it goes away in packaged build, it's too bad to ignore.
Profile and optimize your game
For example sending too much data to clients would mess up their experience
Also editor content is not cooked
So take that into account
Happens in empty level with any character (incuding starter FPS character)
I've heard people solving by turning off UDP messaging but doesn't work / not a solution for me
Wait wut? what does that do
No idea. No effect for me so irrelevant. Really frustrating and hard to search for because anything realted to "frame drops" or "Stuttering" brings up all sorts of shit. I'm getting a regular drop in frame rate every couple of seconds. Infuriating. Only had this since moving to 5.2 I think
Calling too many reliable multicasts perhaps?
hello, I have a question for my game, whoever won the mini games should write their name and everyone's score should appear in a list. Does anyone know of a guide video for me to do something like this?
Happens in blank project with basic player controller so something with the engine/my system .../sigh Was hoping it would be somewhat common
If you're talking about an online system with a bunch of people their names / scores those are called "leaderboards", there should be plenty of information about it on the internet by searching with that word. If you're however referring to something along the lines of for example 4 friends playing against each other and just at the end listing their scores etc. then I don't really think there are any guides or videos for that. It's also not a very difficult thing to achieve I would say if you've gotten that far. The score part is just simply keeping track in for example the player state of a player what their current score is. A name can just be send from the client -> server whenever they are done with entering their name and can then be replicated to other clients through for example again the player state (I believe Unreal even provides a default name system) ๐
First of all, thank you very much for your answer ๐ I looked a lot but I couldn't understand the logic ๐
Any good tutorials to learn how to make multiplayer games?
Plenty to pick from in this channel pins
Would anyone here be able to fill in some gaps for me in the process of building a headless dedicated server, but having the ability to access a classic server browser list from the client end, specifically with hosting the dedicated listings on steam servers? I know this is a broad topic, but I'm semi-versed in how the RPC works between the clients and server while working from within the editor, I just need a more refined look at the entire pipeline.
Yo! When i wanna sprint on client got stutter
I would find it very unlikely Unreal provides a way to do what you're asking for because assigning to replicated properties on a client is a valid technique to use for prediction. If that would invoke the onrep which is only supposed to be invoked by the server changing state then you get a very messy situation really quickly. If you simply want to invoke the method you assigned to be the callback you can do so your self. At least in C++, not sure about blueprints.
Why not just use a setter function that then calls the logic you want when you set the variable vs. directly setting the variable.
That's because you're increasing the movement speed on the server before the client knows about the increase of speed, and then the server corrects the client's position.
You can set it locally on the client first before hand, but then you'll run into a problem if you start introducing lag. The only appropriate way to handle sprinting while using the character movement component is to make a flag that gets stored in the saved moves within the character movement component (needs C++ to do)
If you're asking "how is this normally done?" then all it really is that dedicated servers register to some kind of server and say "hey I am alive and people can join me" from which clients can retrieve a list and in most cases filter based on whatever they want to and then just connect to it. Not entirely sure if Steam specifically provides a way to deal with a dedicated server list. Depending on how many dedicated servers that are in the end you'll probably get some different architectures though. To name a random example AWS Gamelift will probably have to deal with more than a few hundred servers ๐
Thx to reply! Is any way to did it without character component?
thanks for the reply, im looking at the steamworks documentation right now trying to get an understanding as well. My initial assumption of the process is flawed most likely
The trouble is, the CMC is over 3000 lines of code that also handles client side prediction and replication - if you think you could do the same without the CMC, you'd have to make your own movement logic and unless you include client side prediction, you'd have to either live with client authoritative movement (allowing clients to move anywhere in the world at whatever speed allowing cheats) or server authoritative, basically not caring that your clients move laggily and they have to wait for the server to replicate the movement before they see anything.
Thx for ur help dude!
What you're looking at is basically an online subsystem and sessions.
Your server would register with your subsystem of choice, like Steam, EOS, etc. which creates a session. Players can then look up the sessions that your Online Subsystem has available even without being connected to a game server.
The sessions retrieved usually contain whatever is needed in order to establish a connection with that particular server as well.
Doing that from the client side of my code is the part that I feel like is going to be my real entry point for testing(after I get my dedicated server built and packaged and my stuff synced to a depot on steams end)
if im thinking about that right
Im trying to get myself into a full development pipeline with this stuff
I have my version control set up via a helix core/perforce set up on a VM I have
I added a password setting in the Create a session section. What I want is for it to only join the session that matches this password.
How can I do that? (I searched a lot)
I'm just trying to get the full dev pipe running in a way that I can test this stuff from the ground up with full network capability with the platform im trying to host on (steam)
I don't think Steam provides hosting of games. They only provide the subsystem that allows you to look up servers that are running your game.
yeah I will host on my end
that makes it way more convenient honestly
ill just host on my infrastructure, I just needed to know the steps to interact with those session subsystems
Thats the portion of the pipeline I'm unfamiliary with still.
I can fully replicate a unreal game and such, but Id only ever done it via the editor, and through the unreal launcher.
Now im at the point where im doing source builds of the engine with my full version control set up
trying to get an actual dev infrastructure running for a team of people.
Hello. So I made a swimming system by this tutorial:
https://www.youtube.com/watch?v=0UFRpnNb5So&t=480s
And it works fine, just when I set the "water volume" to true, then it sets it for both of the players (I use two players) and I didn't find any solution or swimming system alternatives. Do you have any idea how to solve it, or another swimming system?
Hello guys, in this quick and simple tutorial we are going to make a simple swimming system, which will make the player able to dive and come up to the surface in Unreal Engine 5.
Animations package: https://forums.unrealengine.com/t/updated-v2-free-cmu-mocap-animation-library-2500-retargeted-to-ue4-skeleton/100523
Follow me on Twitter: https:/...
Run On Server > Run on Owning Client
If you do this, you can only run this action on the current client.
Run On Server > Multicast
If you do this, you can take the action and reflect to others that you did the action.
After clicking Event, you can access what I said (run on server etc) from the details panel on the right.
The only thing I want is to add a Join a Private Session button and connect to the session that has that password when I type the password. Pls just tell me the logic, I'm ready to investigate.
Just reading the session setting is something like this, keep in mind, you probably wouldn't be directly checking from the Find Session node and you'd have additional logic to display all found sessions with custom buttons for joining a private session that would popup a widget requesting the password and you could then check it against the appropriate session result. Also, this isn't a secure way to handle the password as it would be accessible to a client once they retrieve the session and someone with a little know-how could read it and then enter the server.
Thank you so much. I wonder something, why didn't we use a scanning system like "for each loop", does it automatically scan all sessions?
Does this system you give work as the main logic,
Scan the all session as a list,
If there is a session with a string named "Password", send it to "Found".
You meant something like this?
Now it changes between walking and swimming when I'm trying to move.
As I pointed out, I'm just showing you how to read an extra setting value from a session, not an all-encompassing tutorial on how to create a session listing, creating widgets for the list of sessions retrieved, and handling join logic.
im new to UE multiplayer and trying to make a FPS game. im trying to figure out should damage be handled from game mode or is it ok to apply damage from one actor's BP to another, can someone help me which way is better
No no. That's not what I meant, you misunderstood me. I was just wondering if "get extra settings > get session property" works like a loop?
So, in the background of the job, does this scan all sessions and find the session that has the key named "password", or does it look at a single session?
is there a way to hide/destroy an actor for a client once it's no longer relevant?
I fully understood what you were asking and that's why I responded the way I did. The Find Session node returns an array of sessions, the next thing I did was getting just the first session in the returned array (that is the Get 0 node) and that gives me a reference to a single session which I can then feed into "Get Extra Settings". Again, I'm only doing it that way just to show you how to read the extra settings of a single particular session result. The "Get Extra Settings" > "Get Session Property" bit does no looping on its own.
You would have to loop through the array of found sessions and do what you want with that array to display the found sessions, but you wouldn't loop through that array to check if the password you entered was correct for each of the sessions in the array.
What you would do, is once you know what session you want to attempt to connect with, is check that particular session's extra settings for some typed in password, and if it is correct, then you'd join that session.
Find Sessions > Loop through and create widgets representing those sessions feeding in reference to the session (likely with a join button of some kind in the widget) > Add widget to a container of some kind to display it.
On click of your Join button > Check if associated session has a password setting > If it doesn't then join the session. If it does, prompt for password > On submit of password, check password == session's password, if so, connect
Thank you soo much, it couldn't be more clear!
No, I didn't mean that. But you're close.
All calculations are done on the server, so we use "RunOnServer". Create one custom event, make it RunOnServer. Create one more custom event, make it Multicast. It will be RunOnServer > Multicast. Then Multicast > functions etc. But the variables must be on the server side.
It is very difficult to explain in writing, you can solve it by watching a video for a few minutes.
This is called the "RPC" system. You can search for unreal engine multicast tutorial.
While on the subject; Using a single code, how can we log quickly in to a session that has this code?
I'm talking about entering a specific session directly, not the password that comes up after the session is found.
It's like quickly entering their lobby with a code that our friends gave us in CO-OP games.
I'm not 100% sure on this as I haven't done it myself, but you'd need something that can generate a unique code, verifying that code isn't in use currently, and then when creating the session enter that code through the session settings. Hopefully the code wouldn't be too long or confusing either ๐
A client could then do a search for sessions, filtering based on the associated code. Find a result - join, if no results, then invalid code.
I have no idea if any online subsystems have something that could handle something like this already, but that would be the gist of how it would have to work.
This maybe? (sorry for the issues, but I'm quite new to Unreal Engine)
This will fix your problem.
I am able to generate unique code. This is exactly where I am stuck:
"A client could then do a search for sessions, loop through them checking to see if the code they entered is == to the code associated to the session, and if so join, if no results, then invalid code."
"Find Session > Result > For Each Loop"
All sessions that I can connect to are scanned, one of them is selected with the for each loop. Whereas "for each loop" should only scan the ones that have the code.
According to the method you gave, 1 session is selected and if the code is invalid, the system stops. Again, I have to go back and scan.
If I scan again, it's still the same session. And it is always invalid.
I couldn't figure out how to find the one with that code among those sessions.
Would be one of these two. Looping through is probably a little less performant than trying to filter from the get-go.
I think if you went the filter method, you'd need it to be exact, so you may want to auto-capitalize or lowercase everything.
Testing with null subsystem, the extra settings works, but I'm not sure the filter does. You can still retrieve the settings and check in the loop.
Okay, so now, is it okay?
It's fine, except for one thing, you have to run the booleans on the server side like the others. (xyoverride, z ovveride and water, is swimming)
Thank you so much I'll try that!
I think it should be good now. I hope...
Well it didn't work, it just does the same. :c
@sinful tree you tell about player array , can you tell that syntax please
The Game State has an array called "Player Array". This is an array of all the playerstates currently in the game. You can loop through them and cast to your custom class to read/set values or call functions on the playerstate.
For c++ in
TArray<PlayerState* > is the variable in which i can store ?
If you wanted to cache it, yes, TArray<PlayerState*>.
one quick question
if i play with 3 player with llisten server in editor mode
then why it only shoows playerArraySize is 1
do i need to build and test on other machine ??
Either you're calling it too soon (ie. on BeginPlay of something which may happen before the players have connected to the listen server) or you're running standalone without connecting the players to the server.
beginplay is the issue ๐
APlayable_char* PlayableChar = Cast<APlayable_char>(ArenaPlayerController->GetPawn());
if(PLayableChar)
if condition its only valid on server pawn
cant on client pawn
@sinful tree
Player Controllers only exist on server and the owning client. They aren't valid on other clients.
PlayerStates have a variable called PawnPrivate which can give you a reference to the Pawn they are currently possessing, however, it will be null on clients where the pawn is not currently relevant.
no variable PawnPrivate
It's there. It's a private variable, can only be accessed within PlayerState. There is a GetPawn() function in PlayerState.
one more question
think i am creating a simple thing like every client choose a number and after choose server add up all the sum and tell every client that this is add result
so i dont need to replicate the client variable ??
because server only need local client variable ??
Hello, I am trying to show the picture of my character in the inventory to be local and alive. But the problem I have is that the texture target is one, that is, the character of the last player in everyone's inventory appears.
i assume you're doing it from a BeginPlay of a Character?
all Characters on all machines run their BeginPlay
you'd want an IsLocallyControlled Branch there if is
Preferably do it from RecieveControllerChanged
At BeginPlay it can be a false negative
Anyone tell ?
I mean, you gotta tell the Server what the Client choose
Replicate ?
ServerRPC
is it better to have a single replicated struct containing all the variables you want to be replicated, or to have separate replicated variables?
inside a BP
for network performance
No idea what the GameMode and PawnOwner has to do with that
But you can use the Role just fine
Depends
how often is it updating, how big is it, is all of it changing all the time or just some of it, etc
My server spawns a building (actor) that has a replicated InteractionComponent. When a client interacts with it, I'm trying to call the component's UPROPERTY(Server, Reliable) ServerRPC_Interact(..).
I'm getting No owning connection for actor BuildingBP_C_0. Function ServerRPC_Interact will not be processed..
Is what I'm trying to do illegal?
I don't want to route everything through my player controller..
Hello, does anyone know whether it's possible to get any of this information client-side?
The code from the screenshot is run server-side when I have to disconnect a client beacon, thought I can't really find how I can know that the client-side client beacon has been disconnected from the server.
That's just how it is in MP. A lot of things will get routed through the PC or their Pawn.
You can only call a server RPC on something that you own
like I have about 10 variables, most of them are float and bools
should having it in one replicated struct be better for performance?
Hi, in a multiplayer game if you kill another player, should you destroy the player and respawn it accordingly or should you just keep the player in play and do a "transition"? idk what that transition entails but im just thinking here.
It depends what suits your game. However in a simple case I would destroy the character, and then respawn it using the game mode.
In more complex cases you may want to give player ability to be respawned, so maybe destroying the character wouldn't fit since you may want to play revive animation or something, or have the corpse to even show the posibility to respawn the character.
Okay I see, thank you. So if I'm thinking of revives and what not at the current location of death its best to keep the player in play. But if not, its better to just destroy the player, in the most simple manner.
Are you talking about the revive in sense that someone (a human) can revive a player or that the system will be doing that?
A player reviving another player. This isnt my goal im just trying to make sure I understand. Not sure if you play video games yourself. But maybe like in valorant sage reviving someone, or in gears of war picking someone up when they're downed
Well, it heavily depends on the type of game you're making as well. Usually no one will be standing on the player corpse, but it may be the case, and it would be a bit problematic to respawn a player on the that spot. You may want to basically push players away once the player respawns. To improve that you may want to do some sort of explosion on the revive spot, it may not suit your game though
Okay awesome as long as I understand when I should use destroy or just transition the death. Which i think I do. Thank you! Yeah I believe some games like valorant push everyone out of the way so you dont clip through each other.
If i have some Replicated variables in an actorcomponent that is attached to my character, and i have marked my character as bReplicates = true; the replicated variables inside my actor component should be replicated across all clients by default ?
The variables only seem to replicate when i set Replicated = true in the blueprinted version of the actorcomponent
Yes but you need to make RPC functions to change the variable on the server. For example if youre trying change a bool , you need to make a UFUNCTION(Server, Reliable, WithValidation) void ServerSetBool(bWhatever)
@valid bough yes im doing that
Are you replicating the variable and stuff too? and have a DOREPLIFETIME?
Yes in my ActorComponent.cpp class I have overridden GetLifetimeReplicatedProps and assigned doreplifetime to the variables
then I have insantiated the actorcomponent as a blueprint and are calling the functions from there
Okay so I dont know your code, but it can be a logical error too. You might not have authority. The best thing to do is to add logs and follow the debugger.
ok so is that why its possibly working when i set the component to replicates ?
I kinda dont want to replicate the whole component thats the thing
Only a few variables inside it. but ok ill read up about if thats true then i might have to the way ive done it
I dont want to, but i tried to see what happened and then it works yes.
They can be. It's generally advised to do it through an actor though.
Got it, so yeah i would go through actor Belzebub
Yeah not sure how to do that since the replicated variables needs to be in the actorcomponent
otherwise it defeats the purpose of how i set everything up with the component
The component is supposed to handle everything including replication of its own variables, but i dont want to replicate the entire component
I would try just moving the RPC code to the character and then call the functions in the component?
I might have to replicate the whole component if i want it to be responsible for everything I guess. If i called this function as an rpc through the character it probably would work, but im doing something on beginplay in the component itself. think thats the problem
Dont know if its reasonable to start the process from the player, cause then it assumes that will always have this component
Hello everyone, I'm giving up on this issue, so basically, these commands are not working when you open a level with ServerTravel (work fine with OpenLevel) also other commands work just fine only the viewmodes commands.
Hmmm yeah probably just better off replicating the whole component then.
@valid bough it kinda makes sense now that i think about it, how can the component be completely self sufficient if its not responsible for all its own replication
Yeah that makes sense because I know people make Health Components and what not.
I'm sure i'm missing something here, but it seems that the steam sessions are broken at least in 4.27. Our dedicated server build is not reporting the player count to steam. I can see in FOnlineSessionSteam that the players are being "registered"/"unregistered" as they join/leave.
Can anyone point me in the right direction for where to look to figure out whats causing this? it seems this reporting is not done from FOnlineSessionSteam
@carmine ember check in the FOnlineSubsystem or the steamSDK
@carmine ember where are you getting the player count from ?
Yeah i've looked here before and the only thing i can find is that there s a port for the game server itself and a port for queries, but I've not been able to find any meaningful usages of this
I'm just using the engine code to get the player count, which is taken from the steamworks sdk's query result, which is 0
The function is called UFindSessionsCallbackProxy::GetCurrentPlayers
ok if u check the FOnlineSessionSettings theres some variable there for public connections maybe check that?
i mean from the SessionResult
FSessionResultData this object stores some data about current players aswell, maybe check if thats the same
Sorry im stupid thats my own implementation of it
Yeah thats what i'm using, that is populated from the query to steamworks sdk, which is returning 0 players
Result.Session.NumOpenPublicConnections but this one u can get from the result FOnlineSessionSearchResult
so steam, itself, thinks there's zero players
hmm ok then
and steam's server browser reports zero players too, to confirm this
so it seems the server itself is not reporting the player count to steam
@carmine ember same happened to me with EOS, tried for months then I gave up
always returns zero
ue5
That makes me think its part of one of the UE4 abstractions rather than steam itself
That variable only works with local mp subsystem
@shrewd ginkgo if you're using steam you need to provide the -SteamServerName="SOMETHING HERE" command line argument
Your component will only replicate the props set to be replicated, basically that's how it works. You can't simply replicate an entire component, because that'd require some de/serialization extensions to it, which is not supported by default. Btw comps are only slaves to the actor's replication behavior, so it always depend on actor's replication settings.
Hey guys. Trying to make my players have the same ID for level generation here, and Im using GameState to convey the seed ID. However, my client can't Cast to the GameState - how should I tell the client what the ID is? I read that GameState is accessibly by both server & client, but can't be modified by the client?
Client shouldn't be modifying it anyway - you're just reading data
Help please
Yeah, it was just reading data. I added a delay to the cast, it seems the controller was trying to read the gamestate object too soon. Got it working, yay ๐
Don't rely on delay in a networked environment
It's bound to fail in a real-world scenario
What's the way to go about doing it then? It's just at the beginning of the play session, and players are locked in place while it's generating the level
You can override the OnRep of gamestate I believe. (C++ only though).
Aaah I see. I'm just dabbling with blueprints sadly
Maybe I can hire someone to fix that up down the road ๐
Well, if it is a custom GS, you can also just do an OnRep for that variable specifically.
@rotund sapphire thanks yeah ok well then it makes even more sense in this case to just replicate all the props
in Engine\Source\Runtime\Engine\Private\GameViewportClient.cpp check UGameViewportClient::HandleViewModeCommand i think it's a debug-like cheat command which depends on many things to be available or not - maybe you can figure out for yourself, but it seems "clients" are not supposed to use that command and the debug view is unlikely exists in a shipping build anyways so don't use that command. Maybe you should consider implement a similar vfx in a postprocess material rather - if possible.
Thanks for the answer, even the server can't use it when I user ServerTravel, but when I use OpenLevel function is just work even in a shipping build. I tried to replicate it in pp material but no luck
that command requires a cheat manager. Which would require running EnableCheats and the server not rejecting it.
#if UE_BUILD_TEST || UE_BUILD_SHIPPING
Ar.Logf(TEXT("Debug viewmodes not allowed in Test or Shipping builds."));
ViewModeIndex = VMI_Lit;
#endif
That's pretty much states it shouldnt work in a shipping build, but it may be a different method and i'm overlooking something here. Altho it may be is a shipping build you got there, and it still works (yey), the OpenLevel will instantiate a listen server for you, whereas ServerTravel is a client-only mode which is a different networking model and perhaps cheats are unavailable hence the command won't work.
Those view modes aren't meant for use in shipping at all.
I see, I used this to force it r.ForceDebugViewModes=1
I know but I don't have the exeprience to replicate that effect in pp material that's why I used this quick solution
Thank you it worked !
hello, i am not sure why but out of nowhere this fails ( comes out of "ON FAILURE)
the last time i tested to create a lobby it worked just fine, now it wont work
Is there a way to exclude server code from client? using BP?
Not out of the box.
That doesn't strip the server code.
You might be able to hack around doin' it by doing a lot of BP classes that are server only and the client interacts with a server rpc that would then talk to the server only BP class. On package, just exclude the server folder of classes or something. Then for your server, you would include that folder.
That might work.
But is a roundabout way of doing it I'd guess.
Does this qualify as a @hoary lark solution?
i can hardly understand it or how it would work, so: yes
Yeah thats what i did, as long as gamemode is only for server side, I've created the authentication logic inside it, and player controller just sends his token for authentication
So the authentication logic is not exposed
Just...use C++
Even if its exposed it doesn't really matter, but its better
I am, I'm using c++ and BP
Then strip that out use the preprocessor stuff
I just thought there is something equal of preprocessor in BP
yeah already did that
No and there shouldn't be. Because BP is meant for designers.
and wanted to make sure if epic games does the stripping automatically for server side stuff in BP
@opal fox @fringe gate On this I've found something interesting. In the SpaceWarServer.cpp file in steamworks sdk example project there is this code. Look at the comment:
// These server state variables may be changed at any time. Note that there is no lnoger a mechanism
// to send the player count. The player count is maintained by steam and you should use the player
// creation/authentication functions to maintain your player count.
SteamGameServer()->SetMaxPlayerCount( 4 );
SteamGameServer()->SetPasswordProtected( false );
SteamGameServer()->SetServerName( m_sServerName.c_str() );
SteamGameServer()->SetBotPlayerCount( 0 ); // optional, defaults to zero
SteamGameServer()->SetMapName( "MilkyWay" );
#ifdef USE_GS_AUTH_API
// Update all the players names/scores
for( uint32 i=0; i < MAX_PLAYERS_PER_SERVER; ++i )
{
if ( m_rgClientData[i].m_bActive && m_rgpShips[i] )
{
SteamGameServer()->BUpdateUserData( m_rgClientData[i].m_SteamIDUser, m_rgpShips[i]->GetPlayerName(), m_rguPlayerScores[i] );
}
}
#endif
There is code in UE4 that calls BUpdateUserData. However, its never actually invoked. This seems like a bug in UE4, but I would be shocked if a bug like this existed
I need to check if the time has elapsed for 10 indexes and display this time for each index separately in the widget, how would you do it so that it is as efficient as possible? Event Tick and check time? Or 10 timers? Or what?
Try get pawn owner return me unknown on BP animation
Woah that delay is gross
Update animation runs like every frame
The owner is probably not a pawn.
It's a character, so that's the problem
But a character is a pawn, no?
It is
unknown in debug view is fine
is it ever ACTUALLY unknown?
the project settings gamemode and world override gamemode are both called, this is weird
Yep
if (ArenaPlayerController) {
ArenaPlayerController->SetInputMode(FInputModeGameAndUI() );
ArenaPlayerController->bShowMouseCursor = true;
ArenaPlayerController->SetNumber(6);
UE_LOG(LogTemp, Warning, TEXT("player controller"));
}
if i call this function in character then it only work on server not on client
This worked. Idk what's happen
Do I need to do something out of the ordinary to get properties on a player controller to replicate? I have the following:
WorldPlayerController.h
UPROPERTY(BlueprintReadWrite, Replicated)
AWorldObject* ControlledAvatarActor;
WorldPlayerController.cpp
AWorldPlayerController::AWorldPlayerController(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
bReplicates = true;
}
void AWorldPlayerController::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AWorldPlayerController, ControlledAvatarActor);
}
ControlledAvatarActor is set by the server during an RPC call, and should have been replicated back to the player owning the controller. The replication doesn't seem to happen though... it works fine as standalone/listen server, but it remains empty on client. In other words, it doesn't seem to actually replicate.
Maybe it's really obvious and it's just a matter of being blind after far too many hours on the project lately, but... what am I missing?
is that actor replicating?
ControlledAvatarActor is a pointer to another actor seemingly, so that one also needs to replicate
It should, but I may have stuffed something up during my rewrites. Lemme go back and check
Yep, AWorldObject does replicate. For completeness, this is the final part of the RPC back and forth that also occurs in AWorldPlayerController. It sets ControlledAvatarActor here, but it does not seem to be replicated. However, the callback (through custom event HandleControl in screenshot) that it executes does indeed return a valid value.
WorldPlayerController.cpp
void AWorldPlayerController::ReceivePlayerControl_Implementation(FGuid RequestID, AWorldObjectPlayer* AvatarActor)
{
FReceivedPlayerControl* Callback = OnReceivedPlayerControlCallbacks.Find(RequestID);
ControlledAvatarActor = AvatarActor;
Callback->ExecuteIfBound(AvatarActor);
OnReceivedPlayerControlCallbacks.Remove(RequestID);
}
do TMAPs not replicate? even if I wrap them in a struct?
no
Actually, doing some more experiments this seems even weirder. Hooked up a bunch of get display names to print strings to try and figure out what is going on. HandleControl's Avatar Actor shows a valid actor. Checking the ControlledAvatarActor of the casted WorldPlayerController from that same exec chain shows the same actor. However, I have a custom event in the player controller as per screenshot, and there ControlledAvatarActor shows up empty.
Your better option would be to use an rpc that takes a key and value and sets it on the client
Anyone got a good tutorial on setting up a quick dedicated server so i can have like 5 or just a handful of friends play-test on it?
The same dedicated server tutorial that exists for years should still work
Oooh ok thats good to know actually
Build Engine from Source. Package Dedicated Server.
Host it somewhere where you know the IP from and the port is open.
I'm still having the same problem.
How do I get the Net GUID of an actor?
anyone knows which one has better performance in multiplayer games? create actors as subobject or spawn them at begin.
Doesn't really matter. Actors can't be subobjects anyway.
Should be able to get it from the Package Map for the relevant Net Connection. NetGUID's are unique per server/client connection.
Thanks for the insight
Good to know they can be unique between clients
If it's supposed to be local, why are you spawning it on the Server then?
You don't need the whole IsLocallyControlled + ServerRPC if you want to spawn it on the Server anyway.
Then just check HasAuthority and spawn on Authority without the RPC
The code you are running after your Delay is bad
The Delay fixes the ping issues and here won't even work cause your InventoryCharacter variable isn't marked for replication.
You should change the Variable to RepNotify, which gives you an OnRep function (auto generated) in your function list.
You can then move the code that you call after your Delay into that function.
The delay should of course be deleted then.
That all only works if InventoryCharacter is replicated, which I'm still unsure about if it should, cause your original post talked about it being supposed to be local
Which means you wouldn't need the RPC and can just spawn the character locally.
Which removes the need for the delay too.
But I don't have enough info to tell you what of the two options fits your needs.
Thanks. when i spwan actors in the beginning, clients spwan those actors multiple time . can you help me what should i do?
I don't follow. If they are replicated actors, only the Server should spawn them.
that would probably be because you're spawning them from BeginPlay, which executes on every instance of every actor on every machine
erhm yeah ? but how come i can se the cubes then ?
probably because you either had both client and server spawn a cube
or you had all characters spawn a cube
Does the player controller get notified when it's associated game state is ready?
Is OnRep_PlayerState() an acceptible canidate?
BeginPlay theoretically calls on the PlayerController and all other Actors if GameState is "ready" (replicated)
Or did you fat finger Player vs Game?
(PlayerState would make more sense and OnRep for Clients is then correct)
Was wanting the local player to immediately convey player state information at the beginning of the game to all other players
Thus wanting the player controller to push info to the associated player state as soon as possible
Didn't know what was init first Player State or Player Controller
Is there any OnRep_GameState event we can react to ?
Guess ill do per var rep notifies , google dont yield me any valid results :p
There is GameStateSetEvent in World that you can listen to
Might be best to just do it on a per var basis anyways, thanks tho, I'll keep that in mind
can i spawn UObject on client side and send it to server in RPC somehow? is it possible anyway? or struct is my only option?
If you want to send runtime data then a struct is your only option.
Use FInstancedStruct if you want to use the same RPC to send different data types
why the hell is this getting Null reff
ive scheckedf the "what weapon int" it gives correct value
ok nevermind
Any idea why animation bp is replicate only for movement cache? Second pic it's how looks in game and third it's how have to look when i have a gun
I check rifle anim bool and it's working ok
Hey everyone, I am trying to destroy an actor by clicking a widget button attached to the actor from a client but nothing happens. I am calling Server RPC on click. Any idea how to go around this?
void UBaseInteractable::OnGOButtonClicked()
{
Server_PickupItem();
}
void UBaseInteractable::Server_PickupItem_Implementation()
{
Multicast_PickupItem();
}
void UBaseInteractable::Multicast_PickupItem_Implementation()
{
if (Owner)
{
bool bDestroyed = Owner->Destroy();
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Picking up: %d"), bDestroyed));
}
}
Message is printed on screen and owner exists.
Clients can't call RPC's on actors/objects they don't own.
Also you don't multicast destroy, the actor should be replicated and you destroy it server-side only.
Move the RPC to something you do own, and pass the target as an argument
Thanks! I moved the logic to player controller and it worked!
I am very dumb plz help ๐
I'm trying to get Lyra LAN multiplayer to work on UE 5.2
In the Lyra menu, I can start a session on one computer, see the session in the menu on the second computer. However, when I click to join, I get a bunch of errors
Does EOS need to be enabled to play Lyra locally? (had a brief look into this and getting it setup seems intimidating...)
Any help/advice would be greatly appreciated ๐โโ๏ธ
You don't need to have EOS to play locally. I get a bunch of errors perhaps you should list them ๐
Hello, I need to create online beacons as soon as the player enters the world, in can be both clients and servers. What event is out there to get that information?
how can I get session result
I want to disable 4 connected player border if maks player 4
I'll see if I can grab a screenshot ๐ค
Off the top of my head, I remember it saying something about different versions being used, but the projects were identical ๐
I'm not sure whether you can play Lyra using two different computers though, I have never tried to myself, though it seems like it should be a thing
Hey guys, i'm new to blueprinting and i'm trying to make an among us type of game:] I'm trying to change a bool of "is impostor" in the player state here but i think i'm confusing myself ๐ฐ
how do i make multiplayer i tried to make it and i packaged it and i testes it with my friend, but we couldnt find each others session
u need to make an event that runs on the server
is rifle anim is not replicated
I replicated and now it's working only for sv
if client do it, i can't see it
so it's not replicated properly
your rifle is not replicated properly, or your bool
or somewhere down the line
you're missing repnotifies
right now I am guessing you only inform the server and the owning client
or even only the server
not the other players
so does anyone know how i can make a multiplayer system so my friends with different networks can join
uhhhhhhh where do I even start
you would have the gamemode on the server determine who is the imposter
then just set a variable
ideally a repnotify
on that variable
and that is about it
Right now I don't even know if you replicated anything in that event, doubt u did
The event doesn't run on server and even if it did, it's only setting the variable wherever it runs
weird question
just to make it so
my friends can join the session
i quit unreal engine a while ago
cause i couldnt make it work
my friends couldnt find a session
well easiest would just be the advanced sessions plugin
would that work?
with steam even easier
i had the wrong version
someone told me that
i had 4.27 i think
does multiplayer work on that?
haha yes it does, unreal tournament, unreal engine
or maybe i just packaged it wrong
it works since the beginning of times
what are the packaging settings for multiplayer
cause all my game ideas have multiplayer..
if you're going to host dedicated servers, you need the source version of unreal engine
it worked when i opened 2 windows on my pc
then i could play multiplayer with myself..
but my friend couldnt find any session
yeah, that is because you probably only have the sessions run locally
How have you set up sessions?
What online subsystem are you using?
wym locally how do i dont run it locally then
eos costs money right?
idk, don't use it
If you haven't set up a subsystem, your friend should still be able to connect directly via ip:port
steam is 100 bucks for an app
what if hes on another network
if he has a static ip
then you need to have an API
just to play with someine
what API
your own
.
how do i do that
You don't need a static ip...
How do you think you connect to people over hte internet?
billions
Internet literally means inter-network. Between networks. It's almost guaranteed that you're on different networks.
how do i make that system
you will figure it out
He's trolling you massively.
those basics will tell you
what database would i use
?
nope
Just google how to set up EOS or something.
I told him that as well
Or use direct connection via ip:port.
he wanted a way without it
ye but does it work
no, we're telling you a way that doesn't work
this
so can i just use a subsystem without making the API
that is what subsystems do for you
yes, they make the process simple
i dont have to retrieve the ips somewhere?
so should i use eos
cause i dont really like steam cause u need it downloaded
http://www.whatismyip.com go there, tell your friend the number and get him to connect to it from teh console.
Check the IP address assigned to your device. Show my IP city, state, and country. What Is An IP Address? IPv4, IPv6, public IP explained.
and some people dont have steam
i want it to be auto
not this
Then you need to use an online subsystem. Be that steam or EOS or whatevevr.
Pick one, add it.
does eos work without epic games being downloaded
cause if someone doesnt have it
it wont work
?
will it work then?
yes
how can I get session result
I want to disable 4 connected player border if maks player 4
Any idea why left hand look like that?
Thank you for the help!! I am in the game mode, i tried replicating as best as i could. Did you mean something like this?
yes, but you need to set the boolean for the player, right now you are setting it for the gamemode
so you would set it in the playerstate
furthermore do not use for loops in this case
drag off the player array and do a for each
you could do a for loop, it's not inherently bad, but most people would use a for each
unless you're doing a random number on the index to decide whichj numbers are the impostor, then it's a good idea
Another thing, create widget is client only, so there is no point calling it here, it's indicated by the screen icon in the top right of the node
How does a replicated TArray of actors behave if some of those actors go outside of the net cull distance?